super
and this
in Java
super
reference in a constructor?
class A { int m1() {return 1;} int m2() {return m1();} int m4() {return m5();} int m5() {return 4;} } class B extends A { int m1() {return super.m2();} int m3() {return 7;} } class C extends B { int m1() {return 2;} int m2() {return super.m1();} int m3() {return super.m2();} int m5() {return 1;} } class D extends C { int m1() {return 3;} int m2() {return super.m4();} int m3() {return super.m3();} int m4() {return super.m2();} }
new D().m2()
?
What is the output of the call new D().m3()
?
What is the output of the call new C().m3()
?