Why is the private method of the parent class Base
visible in the child class Child
in the code below?
public class Trial {
class Base {
private void foo()
{
}
}
class Child extends Base {
private void func()
{
super.foo();
}
}
}
It wouldn't be possible if Base
and Child
classes were not inner classes. Why is this behaviour for inner classes?