Monday, November 10, 2008

mutable and immutable objects in java

As per the dictionary, mutable objects are objects which can change their values and immutable objects are objects which cannot have their values changed.

>>java.lang.String is an example of an immutable object in Java
whereas
>>java.lang.StringBuffer is a mutable object.

No comments: