I have two question on this code
public class Override {
private void f() {
System.out.println("private f()");
}
public static void main(String[] args) {
Override po = new Derived();
po.f();
}
}
class Derived extends Override {
public void f() {
System.out.println("public f()");
}
}
/*
* Output: private f()
*/// :~
1) How is function f is visible on the reference of Override po;
2) Why is output "private f()"