They are called friendly. Public>Protected>Friendly>Private. Read thinking in Java.
g*y
2 楼
It seems I should mark my post. hehe A simple example is that if you inherit form one class, there is one method protected, and you override it with frienly, you will get compile error. Try this. class A { protected int i; A(int i) { this.i=i; } } class B { public static void main(String[] args) { A a=new A(3); System.out.println(a.i); } }