Refined of 1z0-808 practice test materials and study guides for Oracle certification for IT candidates, Real Success Guaranteed with Updated 1z0-808 pdf dumps vce Materials. 100% PASS Java SE 8 Programmer I exam Today!

2016 Sep 1z0-808 free exam questions

Q11. Given: 

public class TestField { 

int x; 

int y; 

public void doStuff(int x, int y) { 

this.x = x; 

y =this.y; 

public void display() { 

System.out.print(x + " " + y + " : "); 

public static void main(String[] args) { 

TestField m1 = new TestField(); 

m1.x = 100; 

m1.y = 200; 

TestField m2 = new TestField(); 

m2.doStuff(m1.x, m1.y); 

m1.display(); 

m2.display(); 

What is the result? 

A. 100 200 : 100 200 

B. 100 0 : 100 0 : 

C. 100 200 : 100 0 : 

D. 100 0 : 100 200 : 

Answer: C 


Q12. Given the code fragment: 


What is the result? 

A. Execution terminates in the first catch statement, and caught a RuntimeException is printed to the console. 

B. Execution terminates In the second catch statement, and caught an Exception is printed to the console. 

C. A runtime error is thrown in the thread "main". 

D. Execution completes normally, and Ready to us. is printed to the console. 

E. The code fails to compile because a throws keyword is required. 

Answer: C 


Q13. Given the code fragment: 


What is the result if the integer aVar is 9? 

A. 10 Hello world! 

B. 10 Hello universe! 

C. 9 Hello world! 

D. Compilation fails. 

Answer: A 


Q14. Given the following main method: 


What is the result? 

A. 5 4 3 2 1 0 

B. 5 4 3 2 1 

C. 4 2 1 

D. 5 

E. Nothing is printed 

Answer: D 

Explanation: 

Loop will run only once and after that num == 0 will break it After first cycle of the loop. 


Q15. Given: 

public class App { // Insert code here System.out.print("Welcome to the world of Java"); } } 

Which two code fragments, when inserted independently at line // Insert code here, enable the program to execute and print the welcome message on the screen? 

A. static public void main (String [] args) { 

B. static void main (String [] args) { 

C. public static void Main (String [] args) { 

D. public static void main (String [] args) { 

E. public void main (String [] args) { 

Answer: A,D 

Explanation: 

Incorrect: 

Not B: No main class found. 

Not C: Main method not found 

not E: Main method is not static. 


1z0-808  practice test

Improve 1z0-808 exam topics:

Q16. 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: B 

Explanation: 

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


Q17. Given the fragment: 

String[][] arra = new String[3][]; 

arra[0] = new String[]{"rose", "lily"}; 

arra[1] = new String[]{"apple", "berry","cherry","grapes"}; 

arra[0] = new String[]{"beans", "carrot","potato"}; 

// insert code fragment here 

Which code fragment when inserted at line '// insert code fragment here', enables the code to successfully change arra elements to uppercase? 

A. String[][] arra = new String[3][]; 

arra[0] = new String[]{"rose", "lily"}; 

arra[1] = new String[]{"apple", "berry","cherry","grapes"}; 

arra[0] = new String[]{"beans", "carrot","potato"}; 

for (int i = 0; i < arra.length; i++) { 

for (int j=0; j < arra[i].length; j++) { 

arra[i][j] = arra[i][j].toUpperCase(); 

B. for (int i = 0; i < 3; i++) { 

for (int j=0; j < 4; j++) { 

arra[i][j] = arra[i][j].toUpperCase(); 

C. for (String a[]:arra[][]) { 

for (String x:a[]) { 

D. toUpperCase(); 

E. for (int i:arra.length) { 

for (String x:arra) { 

arra[i].toUpperCase(); 

Answer: C 

Explanation: 

Incorrect: 

not A: arra.length is 3, but the subarrays have 2, 3 and 4 elements. Index will be out of 

bound. 

not B: The subarrys are of different lengths. Index will be out of bound. 

not D: Compile error. 


Q18. Given the code fragment: 


What is the result? 

A. Reading Card Checking Card 

B. Compilation fails only at line n1. 

C. Compilation fails only at line n2. 

D. Compilation fails only at line n3. 

E. Compilation fails at both line n2 and line n3. 

Answer: D 


Q19. Given the code fragment: 


Which code fragment, when inserted at line 3, enables the code to print 10:20? 

A. int[] array n= new int[2]; 

B. int[] array; array = int[2]; 

C. int array = new int[2]; 

D. int array [2] ; 

Answer: A 


Q20. 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: C