Wednesday, 8 May 2013

How to create Userdefined Immutable Class in Java

How to create Userdefined Immutable Class in Java


1) Define class as final 
2) Define private member field as final 
3) set member field value only through constructor 
4) define only getter method of member field.

No comments:

Post a Comment