Mutable Objects :
When you have the reference to an object and if the reference of the object can be altered it is known as Mutable
Object.
A Mutable object is a kind of
object whose state can be modified
after it is created.
Eg : String Buffer.
Immutable Objects :
When you have the reference to
an object and if the reference of that
object if it cannot be altered it is
known as Immutable Object.
An Immutable object is a kind of object whose state Cannot be modified after it is created.
Eg: String, Byte, Character, Double, Float, Integer, Long,
Short, and Boolean are
immutable classes in Java
No comments:
Post a Comment