Regarding an Immutable class defensive copying
问题 I have a query regarding creating a Immutable class. Following are the points which I take in consideration: Make the class final Make all members final, set them explicitly, in a static block, or in the constructor Make all members private No Methods that modify state Be extremely careful to limit access to mutable member components(remember the field may be final but the object can still be mutable. ie private final Date imStillMutable) - See defensive copying or its cousin copy