Immutability is a powerful and simple concept in programming theory that is strangely underused.
An immutable object is simply a class whose instances cannot be modified. This is in contrast to a mutable object or changeable object, which can be modified after it is created.
Immutable objects are also useful because they are inherently thread-safe. Other benefits are that they are simpler to understand and reason about and offer higher security than mutable objects
All the information contained in each instance is provided when it is created and is fixed for the lifetime of the object.
An example of immutable objects in Java is the String class.
Why are immutable objects so good?