What is Mutable and Immutable Objects?

Showing Answers 1 - 5 of 5 Answers

Rajashunmugam

  • May 10th, 2006
 

 Ans:String is Immutable Object. String Buffer is Mutable Object.

  Was this answer useful?  Yes

The objects whose contents can be modified are called as MUTABLE objects.Ex : StringBufffer class objects.The objects whose contents cannot be modified are called as IMMUTABLE objects.Ex : String class objects. String class objects are immutable because JVM takes more time to reallocate memory to the same object than to create a new object.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions