119. A.
B.
C.
D.
E.
F.
G.
abstract class Dog implements Animal { private int Age; }
abstract class Dog extends Animal { public void run() { }; }
abstract class Dog extends Animal { private int Age; }
class Dog extends Animal { private int Age; }
class Dog extends Animal { public void run() { ;; } }
class Dog extends Animal { public void setName() { } }
abstract class Dog extends Animal { public void setName() { }
}
H. abstract class Dog extends Animal { public void run(); }
120. 2. Given :
Which code inserted individually at line 6, will make use of
polymorphism? (Choose all that apply.)
A. void call(I x) { x.set(); }
B. void call(A x) { x.set(); }
C. void call(B x) { x.set(); }
D. void call(C x) { x.set(); }
E. void call(A x, B y) { x.set(); y.set(); }
F. void call(C x, C y) { x.set(); y.set(); }
121.
122. 3. Drag and drop code s into empty boxes to complete the C
interface .
125. Which statements are true ? (Choose three . )
A. This code will output A.
B. This code will output B.
C. If remove line 6 and 7, This code will not compile.
D. If remove line 9 and 10, This code will not compile.
E. If remove line 6 and 7, This code will output B.
F. If remove line 9 and 10, This code will output A.
126. 5. Given:
Which statement, insert at line 3, will compile?
A. CupSize c = Medium;
B. A.CupSize c = CupSize.Medium;
C. A.CupSize c = A.CupSize.Medium;
D. A.CupSize c = new Medium();
E. A.CupSize c = new CupSize.Medium();
F. A.CupSize c = new A.CupSize.Medium();
127.
128. 6. Which statement is true? (Choose all that apply. )
A. A protected static method can be overridden by it's subclass.
B. A protected final method can be overridden by it's subclass.
C. A private final method can be re-defined by it's subclass with
the same signature.
D. A private static method can be called only within the static
method in the same class.
E. A non-static method can NOT be called within any static
method.
F. A abstract final method can be implemented only within
abstract class.
G. A public static method can be called by it's subclass without
explicitly referencing the superclass.
129.
130. 7. Given:
Which one, inserted at line 5, will create an Tire object?
A. Tire t = new Tire();
B. Tire t = new Car().new Tire();
C. Car.Tire t = new Car.Tire();
D. Car.Tire t = new Car().new Tire();
E. It's impossible to instanciate Tire class at line 5.
131. 8. Given:
Which two statements are true?
A. Compilation will fail at line 1.
B. Compilation will fail at line 2.
C. Compilation will fail at line 4.
D. Compilation will fail at line 8.
E. Compilation will fail at line 9.
132.
133. 9. Given:
Which code, inserted at line 7, will cause an Exception at
runtime?
A. A x = b;
B. A x = (A)b;
C. A x = (B)(A) b;
D. I x = (A) b;
E. I x = (C) b;
135. Which statement is true?
A. Compilation fails at line 3.
B. Compilation fails at line 5.
C. Compilation fails at line 7.
D. ((D)new E( )).b( ) will invokes the version defined at line 4.
E. ((D)new E()).b() will invokes the version defined at line 7.