I have the following class:
public class X {
public void A() {
B();
}
private static void B() {
System.out.println("111111111");
}
}
Now I have the following inherited class Z:
public class Z extends X {
private static void B() {
System.out.println("22222222");
}
}
now if I do
Z myClass = new Z();
Z.A();
I will get: 111111111 as a result. (Also, eclipse tells me that B() in the inherited class is never called).
Why? And how can I run the inherited B method?