class Book implements Cloneable{ private String name; public Book(String name){ this.name=name; } @Override public Book clone(){ Book book=null; try { book=(Book)super.clone(); }catch(CloneNotSupportedException e){ e.printStackTrace(); } } } public class Clone { public static void main(String[] args){ Book book1=new Book("Java"); Book book2=book1.clone(); } }