Here's my code
这是我的代码
Package a
package a;
import static net.mindview.util.Print.print;
import b.B;
public class A
{
protected void f()
{
print("This is A's protected f()");
}
public static void main(String[] args)
{
// new B().f() does not work!
// compiler will complain B.f() is not visible
A a = new B();
a.f(); // but using polymorphism here! I can invoke B.f()!
}
}
package a