1) add a copy constructor to the class. This constructor then copies the state of the passed object to its own state.
2) override Object.clone().
In both cases you need to be aware that simply copying all your fields will share data. If your fields are not primitives or immutable (like
String, the wrapper classes)
you should copy those too.
An example, using a copy constructor: