Benefits of Immutable class in Java
An immutable class is a class whose instances cannot be modified after it is created. In this post, we will look at the benefits of immutable class in Java.
class
An immutable class is a class whose instances cannot be modified after it is created. In this post, we will look at the benefits of immutable class in Java.
An immutable class is one that does not change its state after its construction. In this post, we will see on how to make a class immutable. We will see an example class that is not immutable. Then, by applying the steps or the rules outlined we will make it immutable.