日期:2014-05-20 浏览次数:20688 次
interface InA extends Cloneable { public void method1(); public Object clone() throws CloneNotSupportedException; } class C1 implements InA { public void method1(){} public Object clone() throws CloneNotSupportedException {return super.clone();} } public class C2 { public static void main(String[] args) throws Exception { InA a = new C1(); Object b = a.clone(); //出错,不能这样写,需要怎么实现这个功能? System.out.println(a); System.out.println(b); } }