摘要: http://www.itzhai.com/java-based-notebook-the-object-of-deep-and-shallow-copy-copy-copy-implement-the-cloneable-interface-serializing-deep-deep-copy.html 阅读全文
posted @ 2014-03-28 23:30 Jarvan 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Cloneable接口声明中没有指定要实现的方法,一个类要实现Cloneable,最好是覆盖Object类的clone()方法。1. 如果类没有实现Cloneable接口,调用类对象的clone方法抛出CloneNotSupportedException。Java代码publicclassCloneableTest{publicstaticvoidmain(String[]args)throwsCloneNotSupportedException{CloneableTesttest=newCloneableTest();Objectobj=test.clone();}}结果是抛出CloneNo 阅读全文
posted @ 2014-03-28 23:26 Jarvan 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 原地址 http://blog.csdn.net/gideal_wang/article/details/4316691 阅读全文
posted @ 2014-03-28 21:31 Jarvan 阅读(147) 评论(0) 推荐(0) 编辑