First, we have these two classes.
public class Superclass {
public void printMethod() {
System.out.println("Printed in Superclass.");
}
}
public class Subclass extends Superclass { public void printMethod() { //overrides printMethod in Superclass super.printMethod(); System.out.println("Printed in Subclass"); } public static void main(String[] args) { Subclass s = new Subclass(); s.printMethod(); }}
In Eclipse, I tried using the debugger "Step Into", but instead of telling me where its execution path is going to go, it jumps from one method on towards the outer part of the source code, thus giving me the error that it can't find the source code of the method which is using the keyword "super".
Whatever the case, the main question is, for the code above, am I correct if I say the execution path in the main() method goes like this?
EXECUTION START
Subclass s = new Subclass();
s.printMethod();
super.printMethod();
System.out.println("Printed in SuperClass.");
System.out.println("Printed in Subclass.");
return void;
EXECUTION END