nerdexam
Oracle

1Z0-819 · Question #200

Given: ``java public class ConSuper { public ConSuper() { this(2); } protected ConSuper(int a) { System.out.print("3"); } public ConSuper(int a) { System.out.print(a); } } public class ConSub…

The correct answer is A. 2134. See the full explanation below for the reasoning.

Question

Given: ```java public class ConSuper { public ConSuper() { this(2); } protected ConSuper(int a) { System.out.print("3"); } public ConSuper(int a) { System.out.print(a); } } public class ConSub extends ConSuper { public ConSub() { this(4); System.out.print("1"); } public ConSub(int a) { System.out.print(a); } public static void main(String[] args) { new ConSub(4); } }
What is the result?

Options

  • A2134
  • B234
  • C341
  • D214
  • E4

How the community answered

(14 responses)
  • A
    86% (12)
  • B
    7% (1)
  • C
    7% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-819 Practice