Given the definitions of the Bird class and the Peacock class:
and the code fragment:
Which code snippet can be inserted to print Fly.Dance. ?
Given this array:
Which two code fragments, independently, print each element in this array? (Choose two.)
Given the code from the Greeting.Java file:
Which set of commands prints Hello Duke in the console?
Given the code fragment:
Which code fragment, when inserted at line n1, enables the App class to print Equal?
Which three are advantages of the Java exception mechanism? (Choose three.)
Given:
What is the result? A. 0:0
100:0
B.null:0
100:0
C.0:0
100:200
D.null:null 100:null
Given the code fragment:
Which two code fragments can be independently inserted at line n1 to enable the code to print the elements of the array in reverse order? (Choose two.)
Given the class definitions:
class C1 {}
class C2 extends C1 {}
class C3 extends C2 {}
and the code fragment:
16.C1 obj1 = (C1) new C2();
17.C2 obj2 = (C2) new C3();
18.C2 obj3 = (C2) new C1();
19.C3 obj4 = (C3) obj2;
Which line throws ClassCastException?
Given this segment of code:
Which two statements, if either were true, would make the code compile? (Choose two.)
Given the code fragment:
Which modification enables the code fragment to print TrueDone?
Given:
And the code fragment:
Which code fragment, when inserted at line 14, enables the code to print Mike Found?
Given this class:
And given this main method, located in another class:
Which three lines, when inserted independently at line n1, cause the program to print a 0 balance?
Given the code fragment:
Which three lines fail to compile? (Choose three.)
This grid shows the state of a 2D array:
The grid is created with this code:
Which line of code, when inserted in place of //line n1, adds an X into the grid so that the grid contains three consecutive Xs?
Given the code fragment:
Which modification enables the code fragment to print TrueDone?
Given the code fragment:
Which code fragment, inserted at line n1, prints The Top element: 30?
You are asked to develop a program for a shopping application, and you are given this information:
Which definition of the Toy class adds a valid layer of abstraction to the class hierarchy?
Given these classes:
And given this main method:
Which two options compile when placed at line n1 of the main method? (Choose two.)
Given the code fragment:
Which code fragment, when inserted at line n1, enables the App class to print Equal?
Given the code fragment:
Which two modifications, made independently, enable the code to compile? (Choose two.)