How to make Java class immutable?

What is immutable class? Immutable java class means its state cannot be changed. Generally the state of the class is determined by its fields or properties. There are certain ways by which we can prevent the state of a class to be unchanged which is explained in detail further. When do we need to make …

How to make Java class immutable? Read More »