Cloning objects in Java is easy. java.lang.Object class provides method clone() that can be used for cloning. It creates and returns a copy of the object.

Java Code:
MyClass obj1 = new MyClass();
MyClass obj2 = (MyClass)obj1.clone();