posted 11 years ago
You have to declare you class to implement Cloneable. You also have to provide a public Object clone() method (or public MyClass clone()). That method should use super.clone() to create a new object, and then do any additional tweaking necessary, such as deep-copying mutable fields if desired.