上面意思是
Object o = new Object();
o.clone();//这里不能引用是因为,方法是 protected。
那我下面的程序为啥可以运行呢?
public class Test {
public static void main(String[] args) {
A a1 = new A();
a1.testP();//引用自己类的protected方法
}
}
class A{
protected void testP(){
System.out.println("=============");
}
}