package project_demo.p1; public class Father { protected void f(){} }
package project_demo.p1; public class Son1 extends Father{ public Son1() throws CloneNotSupportedException { clone(); } }
package project_demo.p2; import project_demo.p1.Father; public class Son2 extends Father { }
注意:Father的clone方法来自于Object类,该方法的可见性为java.lang包和Object类的Father子类,对于Son1、Son2类不可见