Q51. Class StaticField { 

static int i = 7; 

public static void main(String[] args) { 

StaticFied obj = new StaticField(); 

obj.i++; 

StaticField.i++; 

obj.i++; 

System.out.println(StaticField.i + " "+ obj.i); 

What is the result? 

A. 10 10 

B. 8 9 

C. 9 8 

D. 7 10 

Answer:


Q52. What is the result? 

A. 6 7 8 

B. 7 8 9 

C. 0 1 2 

D. 6 8 10 

E. Compilation fails 

Answer:


Q53. What is the result? 

A. 3 false 1 

B. 2 true 3 

C. 2 false 3 

D. 3 true 1 

E. 3 false 3 

F. 2 true 1 

G. 2 false 1 

Answer:


Q54. Given the code fragment:

A. Values are : [EE, ME] 

B. Values are : [EE, EE, ME] 

C. Values are : [EE, ME, EE] 

D. Values are : [SE, EE, ME, EE] 

E. Values are : [EE, ME, SE, EE] 

Answer:


Q55. Given: 

What is the result? 

A. 7 

B. 12 

C. 19 

D. Compilation fails 

E. An exception is thrown at run time 

Answer:


Q56. Given the code fragment: 

What values of x, y, z will produce the following result? 

1 2 3 4 

1 2 3 4 

1 2 3 4 

1 2 3 4 

A. X = 4, Y = 3, Z = 2 

B. X = 3, Y = 2, Z = 3 

C. X = 2, Y = 3, Z = 3 

D. X = 4, Y = 2, Z = 3 

E. X = 2, Y = 3, Z = 4 

Answer:


Q57. Given: 

Which two classes use the shape class correctly? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

F. Option F 

Answer: BE 


Q58. Which two are valid declarations of a two-dimensional array? 

A. int [] [] array2D; 

B. int [2] [2] array2D; 

C. int array2D []; 

D. int [] array2D []; 

E. int [] [] array2D []; 

Answer: AD 


Q59. Given: 

What is the result? 

A. There is no output 

B. d is output 

C. A StringIndexOutOfBoundsException is thrown at runtime 

D. An ArrayIndexOutOfBoundsException is thrown at runtime 

E. A NullPointException is thrown at runtime 

F. A StringArrayIndexOutOfBoundsException is thrown at runtime 

Answer:


Q60. Given: 

How many objects have been created when the line / / do complex stuff is reached? 

A. Two 

B. Three 

C. Four 

D. Six 

Answer: