Refer to the exhibit.
public class Main {
public static void main(String[] args) {
System.out.println("Hello");
}
}
And the command:
$ javac Main.java
$ java Main
Output:
Hello
Now consider this class in another file:
public class Sub extends Main {
public static void main(String[] args) {
System.out.println("World");
}
}
Compiled and run:
$ java Sub
What is the output?Refer to the exhibit. Two Java classes are defined as shown. What is the output when the Sub class is executed?
Select one:
Oracle often tests whether candidates understand that an overridden method in a subclass does not au...