String object is immutable ,how?
We create an object of String and initialize a value to it.
We create more than one reference variable of the same object and trying to assign a new value to it.
if we assign a value to any reference variable then value will be changed of all reference variables.
So java did not gave a permission to implement String Object in this way.
We create an object of String and initialize a value to it.
We create more than one reference variable of the same object and trying to assign a new value to it.
if we assign a value to any reference variable then value will be changed of all reference variables.
So java did not gave a permission to implement String Object in this way.
hi
ReplyDeleteHello
Delete