Question 1 of 205%

Exhibit

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?
Utilizing Java Object-Oriented Approachmedium

Refer to the exhibit. Two Java classes are defined as shown. What is the output when the Sub class is executed?

Select one: