I have three different classes:
1-)
abstract class A {
abstract void one();
void two(){
System.out.println("two");
one();
}
abstract void three();
}
2-)
abstract class B extends A {
void one() {
System.out.println("one");
three();//I think this method has to run
}
void three() {
System.out.println("3");//That
}
}
3-)
public class C extends B {
void three(){
System.out.println("three");
}
}
in the Main method
public static void main(String [] args){
C c=new C();
c.one();
c.two();
c.three();
}
Output :
one
three
two
one
three
three
But I think in second code one() method have to run its three method and it has to show "3" instead of "three" but this code runs three in C class.