1Z0-829 Utilizing Java Object-Oriented Approach • Timed 10 Questions
This is a timed practice session. You have 10 minutes to answer 10 questions — approximately 1 minute per question, matching real 1Z0-829 exam pace. Answer every question before time expires.
Time remaining
10:00
Exam-pace drill
Allow 1 minute per question. On the real 1Z0-829 exam you have approximately 72 seconds per question — this session trains you to maintain that pace under pressure.
Refer to the exhibit. Two Java classes are defined as shown. What is the output when the Sub class is executed?
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?