java.lang.CloneNotSupportedException:at java.lang.Object.clone(Native Method)

Object01 o3 = (Object01) o2.clone();

 异常信息:

java.lang.CloneNotSupportedException: com.sxit.Object01
	at java.lang.Object.clone(Native Method)
	at com.sxit.Object01.main(Object01.java:63)

 原因:

类没有实现Cloneable接口
public class Object01 implements Serializable,Cloneable

猜你喜欢

转载自luan.iteye.com/blog/1813851