class Derived extends PrivateOverride{}
public class PrivateOverride{
private void f(){
System.out.println("private f()");
}
public static void main(String[] args){
PrivateOverride p=new Derived();
p.f();
}
}
/* output:
private f()
*/
想问的是 既然base class的f()是private
也就代表在Derived中看不到f()
那为什么例子中却可以执行出结果?
手机排版 请见谅