05. How to create immutable class - Java Interview Questions

preview_player
Показать описание
#java #interviewquestions #webencyclop

In this playlist I will try to cover all the important java interview questions along with answers in very intuitive, kind of pictorial/animated way.

Complete Playlist:

Next Video:

Video includes:
-- What is POJO and how getters and setters works.
-- Memory structure of while creating objects using constructors
-- What is immutable class or immutable object.
-- How to create immutable class.
-- What is use of final keyword in immutable class.

In this series we will be covering all Java interview questions and answers. This is going to be comprehensive list of Java interview questions which can help experienced Java developers to prepare for an interview as well as upskilling the Java knowledge.

I would always recommend everyone to watch Durga Sir (durgasoft) videos because of extensive in depth explaination on all topics if you have more time.
But here we will try to cover important aspects of Java Programming which are always asked in interviews withing less time.

how to create custom immutable class in java
java interview questions and answers for experienced
java immutable class
immutable class in java with examplecore
java interview questions
core java interview questions
immutable objects
durgasoft java
Рекомендации по теме
Комментарии
Автор

Very nice video .. I really understood this concept ✨ thanku sir

shwetapanchal
Автор

Great explanation, I have referred many sites, ,,Its the best .

bharathr
Автор

Wow ! Very helpful . Need more Java videos like dis . Do more videos.

AK-ttfc
Автор

Thank you for this video, it really clarifies immutable class requirements .. please make more contents

azizatoumi
Автор

I need more videos like this. Thanks so much.

nvs
Автор

Hi Ankit, Really awesome videos, watched all your 5 videos. Now, i am having much better understanding. Many Thanks Mate.

shivttripathhi
Автор

you are simply great thanks so much for this of love.

nikhilbhangale
Автор

You can also create an unmodifiable list in the constructor. Great video. I like your videos.

debkr
Автор

Excellent content 👌, why don't you teach whole Java course like this 👍

shashankbt
Автор

hey ..awsome videos you have on please upload videos

rakeshhariborse
Автор

Awesome content you created, please keep adding more content.. 🙏

diwakar.singh_official
Автор

Great Job, Your explanation is very great. Kindly make more videos

jeganmuthu
Автор

youtube should improve its took almost one year to pop this channel. Nice explaination

paggybhangale
Автор

Great explanation, can you upload hashmap vs concurrent hash map

nancyreva
Автор

Nice explanation. Kindly create videos on java 8 features.

sagarmandave
Автор

Excellent content... Please make some more videos on java interview questions.

kusumbhatt
Автор

Hello, I think hobbyList would be persisted in a stack memory not in a heap memory since its reference of a List. Please correct me if I am wrong?

nilesh
Автор

So final keyword is not mandatory for instance variable? As we already removed setters

ducklinglifejourney
Автор

Qun1) At 6:38, you mentioned to create a new List inside Student constructor. This violates the basic meaning of a constructor. Constructor is only meant for initialisation of the class field attributes and nothing more. As per you that's true, by creating object inside a constructor u are able to prevent the mutation of that List & achieve immutabiity but you have compromised the meaning of constructor in the first place as per me, isn't it? Ankit.

Qun2)
Consider a class Customer which has following fields like (int id; String name; Address address;)
and class Address(int accountNumber;)

class Customer "has-a" relationship with class Account

So now how to make the Customer class immutable?
Yes, add final to customer class level, the add final to all mutable private fields, no setter methods.
Considering the above concern of not creating any objects in the target class constructor(Customer) ... How to handle that constructor issue if this constructor issue is considered?

aniketbharsakale
Автор

u said we use constructor for create an constructor is used to initialise an object na???

shubhamraj
visit shbcf.ru