1.

What Is Immutable Object? Is String Object Immutable?

Answer»

An immutable OBJECT is an object that would not be able to CHANGE its state after creation. Thus immutable object can only be in one state and that state can not be changed after creation of the object.

Yes STRING object is immutable. Once you CREATE a String object the content of that string cannot be modified.

An immutable object is an object that would not be able to change its state after creation. Thus immutable object can only be in one state and that state can not be changed after creation of the object.

Yes String object is immutable. Once you create a String object the content of that string cannot be modified.



Discussion

No Comment Found