public class Prototype implements Cloneable, Serializable{
private static final long serialVersionUID = 1L;
private String string;
public void setString(String string){
this.string = string;
}
public String getString(){
return string;
}
public Object clone() throws CloneNotSupportException{
Prototype proto = (Prototype)super.clone();
return proto;
}
public ObjectdeepClone() throws IOException,ClassNotFoundException{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.write(this);
ByteArrayInputStream bis = new ByteArrayInputStream();
ObjectrInputStream ois = new ObjectrInputStream (bis);
ois.readObject();
}
private SerialObject obj;
public SerialObject getSerialObject(){
return obj;
}
public void setSerialObject(SerialObject obj){
this obj = obj;
}
}
class SerialObject implements serializable{
private static final long serialVersionUID = 1L;
}