package x; public class A extends D{ int k; static void staticF() {} } class C extends x.sub.B { int n=k; // can call despite inherited through package-private from other package void f() { A.staticF(); } } class D{ public void foo(){} }