This might be helpful http://www.javaranch.com/journal/2003/04/immutable.htm
but gist is make all fields private No mutators(set methods) only accessors(get methods) make class final Thanks, G P.S. This was in top search results when I googled it so its encouraged if you do your bit ;) On Sun, Oct 2, 2011 at 8:25 PM, Tikeswar Mohanty <mohanty.tikes...@gmail.com > wrote: > can any body tell me how to declare a class immutable. > > -- > To post to this group, send email to > javaprogrammingwithpassion@googlegroups.com > To unsubscribe from this group, send email to > javaprogrammingwithpassion+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/javaprogrammingwithpassion?hl=en -- To post to this group, send email to javaprogrammingwithpassion@googlegroups.com To unsubscribe from this group, send email to javaprogrammingwithpassion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en