package designMode;
import javax.lang.model.type.ReferenceType;
RealizeType the implements the Cloneable {class
public RealizeType () {
System.out.println ( "particularly successful prototyping");
}
public Object clone () throws CloneNotSupportedException {
System.out.println ( "particularly successful prototype copy!");
return ( RealizeType) to super.clone ();
}
}
public class Prototype {
public static void main(String[] args) throws CloneNotSupportedException {
// TODO Auto-generated method stub
RealizeType obj1=new RealizeType();
RealizeType obj2=(RealizeType)obj1.clone();
System.out.println("obj1==obj2?"+(obj1==obj2));
}
}