6.9 |
Given the following code, which of these constructors can be added to MySubclass without causing a compile-time error? class MySuper { int number; MySuper(int i) { number = i; } } class MySub extends MySuper { int count; MySub(int cnt, int num) { super(num); count=cnt; } // INSERT ADDITIONAL CONSTRUCTOR HERE } Select the one correct answer.
|
6.10 |
Which statement is true? Select the one correct answer.
|
6.11 |
What will the following program print when run? // Filename: MyClass.java public class MyClass { public static void main(String[] args) { B b = new B("Test"); } } class A { A() { this("1", "2"); } A(String s, String t) { this(s + t); } A(String s) { System.out.println(s); } } class B extends A { B(String s) { System.out.println(s); } B(String s, String t) { this(t + s + "3"); } B() { super("4"); }; } Select the one correct answer.
|