Given the code fragment:

What is the result?
A. Jesse 25 Walter 52
B. Compilation fails only at line n1
C. Compilation fails only at line n2
D. Compilation fails at both line n1 and line n2
Given the code fragment:

What is the result?
A. 20
B. 25
C. 29
D. Compilation fails
E. AnArrayIndexOutOfBoundsException is thrown at runtime
Given the code fragment:

What is the result if the integer aVar is 9?
A. 10 Hello World!
B. Hello Universe!
C. Hello World!
D. Compilation fails.
Consider
Integer number = Integer.valueOff 808.1");
Which is true about the above statement?
A. The value of the variable number will be 808.1
B. The value of the variable number will be 808
C. The value of the variable number will be 0.
D. A NumberFormatException will be throw.
E. It will not compile.
Given the code fragments:

And,

Which statement is true?
A. After line 11, three objects are eligible for garbage collection.
B. After line 11, two objects are eligible for garbage collection.
C. After line 11, one object is eligible for garbage collection.
D. After line 11, none of the objects are eligible for garbage collection.
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.)

A. B.

C. D. E.
Given the code snippet from a compiled Java source file:

and this output:

Which command should you run to obtain this output?
A. java MyFile 1 2 2
B. java MyFile 2
C. java MyFile 1 2 3 4
D. java MyFile 2 2
Given:

What is the result?
A. Welcome Visit Count:0 Welcome Visit Count: 1
B. Compilation fails at line n2.
C. Compilation fails at line n1.
D. Welcome Visit Count:0 Welcome Visit Count: 0
Which two array initialization statements are valid? (Choose two.)
A. int array[] = new int[3] {1, 2, 3};
B. int array[] = new int[3]; array[0] = 1; array[1] = 2; array[2] = 3;
C. int array[3] = new int[] {1, 2, 3};
D. int array[] = new int[3]; array = {1, 2, 3};
E. int array[] = new int[] {1,2,3};

Given the code fragment:

You want the code to print:
Sold: 5 items. Stock in Hand: 5 Purchased: 5 items. Stock in Hand: 10?
Which action enables the code to print this?
A. Declare the stock variable and the purchase(), sell(), and printStock() methods static.
B. Declare the stock variable and the printStock() method static.
C. Declare the stock and qty variables and the printStock() method static.
D. Declare the stock variable static.