Java Immutable Class

In this article, we will look how to create custom immutable class in Java. Immutable objects are those objects whose states cannot be changed. For example, you can change the state of an object by changing its attribute’s or field’s value. String is an example of an immutable class in Java. Other examples of immutable … Read more