How To Make A Java Class Immutable
How To Make A Java Class Immutable
Immutable class is a class which once created, it’s contents can not be changed. Immutable
objects are the objects whose state can not be changed once constructed. e.g. String class
An immutable class is one whose state can not be changed once created. There are certain
guidelines to create an class immutable.
super();
this.name = name;
this.age = age;
return name;