Below are some important facts about how to create an immutable class
(1)First we declare a class as final so that it cannot be extended.
(2)Second we create all fields as private so that direct access is not allowed.
(3)Third we will not provide setter methods for variables.
(4)Fourth create all mutable fields final so that their value can be assigned only once.
(5)Fifth we will initialize all fields via a constructor performing the deep copy.
(6)Sixth we will Perform cloning of objects in the getter methods to return a copy rather than returning the actual object reference.