What is an immutable object?



What is an immutable object?..

Answer / Nirbhaya Singh

An immutable object is an object whose state cannot be modified after it's created. Once created, its state remains constant throughout its lifetime, and any attempt to modify it will result in a new instance being created with the desired changes. This can help to prevent unintended side effects and simplify concurrency management.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Why string is immutable or final in java

1 Answers  


Define max and min heap, also the search time of heap.

1 Answers   GrapeCity,


Can inner class be public in java?

1 Answers  


What are the differences between stringbuffer and stringbuilder?

1 Answers  


How TreeMap sorts the objects inside it?? suppose if have include one employee object and one car object. On what basis it will sort?

5 Answers  


What is gui programming?

1 Answers  


Why does abstract class have constructor?

1 Answers  


What is static synchronization?

1 Answers  


Is there a case when finally will not execute?

1 Answers  


What are the advantages of inner classes?

1 Answers  


How can we make sure main() is the last thread to finish in java program?

1 Answers  


Can arraylist contain null values?

1 Answers  


Categories