1z0-808 | Refined Java 1z0-808 dumps


Q51. Given the following code: 

What are the values of each element in intArr after this code has executed? 

A. 15, 60, 45, 90, 75 

B. 15, 90, 45, 90, 75 

C. 15, 30, 75, 60, 90 

D. 15, 30, 90, 60, 90 

E. 15, 4, 45, 60, 90 

Answer:

Q52. Given: 

What is the result? 

A. Base DerivedA 

B. Base DerivedB 

C. DerivedB DerivedB 

D. DerivedB DerivedA 

E. A classcast Except ion is thrown at runtime. 

Answer:

Q53. Given: 

What is the result? 

A. Good Day! Good Luck! 

B. Good Day! Good Day! 

C. Good Luck! Good Day! 

D. Good Luck! Good Luck! 

E. Compilation fails 

Answer:

Q54. Given: 

What is the result? 

A. 100 210 

B. Compilation fails due to an error in line n1 

C. Compilation fails due to an error at line n2 

D. Compilation fails due to an error at line n3 

Answer:

Q55. Given the code fragment: 

What is the result? 

A. Match 1 

B. Match 2 

C. No Match 

D. A NullPointerException is thrown at runtime. 

Answer:

Explanation: 

it will compare the string contents of the StringBuilder with string object. 

Q56. Given: 

What is the result? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q57. What is the proper way to defined a method that take two int values and returns their sum as an int value? 

A. int sum(int first, int second) { first + second; } 

B. int sum(int first, second) { return first + second; } 

C. sum(int first, int second) { return first + second; } 

D. int sum(int first, int second) { return first + second; } 

E. void sum (int first, int second) { return first + second; } 

Answer:

Q58. Given the following code for a Planet object: 

What is the output? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

Answer:

Q59. Which of the following can fill in the blank in this code to make it compile? 

A. abstract 

B. final 

C. private 

D. default 

E. int 

Answer:

Explanation: 

From Java SE 8, we can use static and/or default methods in interfaces, but they should be non abstract methods. SO in this case using default in blank is completely legal. Hence option C is correct. Option A is incorrect as given method is not abstract, so can't use abstract there. Options B and E are incorrect as we can't have non abstract method interface if they are not default or static. httpsy/docs.oracle.com/javase/tutorial/iava/landl/defaultmethods.html 

Q60. boolean log3 = ( 5.0 != 6.0) && ( 4 != 5); 

boolean log4 = (4 != 4) || (4 == 4); 

System.out.println("log3:"+ log3 + nlog4" + log4); 

What is the result? 

A. log3:false log4:true 

B. log3:true log4:true 

C. log3:true log4:false 

D. log3:false log4:false 

Answer: