Example:
class Parent {
public void func(){
System.err.println("parnet");
}
}
class Child extends Parent {
@Override
protected void func(){
System.err.println("child");
}
}
is illegal but if we switch the visibility it is legal. What's the reason why it is designed this way? I can't make much sense out of it.