我的代码如下package com;public class a{ public static void main(String[] args) {
// TODO Auto-generated method stub
a1 test4clone = new a1();
Object a1Clone = test4clone.clone();
}}class a1 implements Cloneable {
public int tt = 2;
}
// TODO Auto-generated method stub
a1 test4clone = new a1();
Object a1Clone = test4clone.clone();
}}class a1 implements Cloneable {
public int tt = 2;
}
a1 test4clone = new a1();
Object a1Clone = test4clone.clone(); LZ,你是调用其他类的clone啊当然不可以了。你不也说了clone的修饰符是protected的。