How to pass Oracle 1z0-808 Real Exam in 24 Hours [exam answers 21-30]

Certified of 1z0-808 torrent materials and free demo for Oracle certification for IT learners, Real Success Guaranteed with Updated 1z0-808 pdf dumps vce Materials. 100% PASS Java SE 8 Programmer I exam Today!

2016 Jul 1z0-808 exam price

Q21. Given: 

public class Test { 

public static void main(String[] args) { 

try { 

String[] arr =new String[4]; 

arr[1] = "Unix"; 

arr[2] = "Linux"; 

arr[3] = "Solarios"; 

for (String var : arr) { 

System.out.print(var + " "); 

} catch(Exception e) { 

System.out.print (e.getClass()); 

What is the result? 

A. Unix Linux Solaris 

B. Null Unix Linux Solaris 

C. Class java.lang.Exception 

D. Class java.lang.NullPointerException 

Answer: B 

Explanation: null Unix Linux Solarios 

The first element, arr[0], has not been defined. 


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


Q23. You are asked to develop a program for a shopping application, and you are given the following information: 

. The application must contain the classes Toy, EduToy, and consToy. The Toy class is the superclass of the other two classes. 

. The int caicuiatePrice (Toy t) method calculates the price of a toy. 

. The void printToy (Toy t) method prints the details of a toy. 

Which definition of the Toy class adds a valid layer of abstraction to the class hierarchy? 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: A 


Q24. Given: 

public class TestLoop1 { 

public static void main(String[] args) { 

int a = 0, z=10; 

while (a < z) { 

a++; 

--z; 

} System.out.print(a + " : " + z); } } 

What is the result? 

A. 5 : 5 

B. 6 : 4 

C. 6 : 5 

D. 5 : 4 

Answer: A 


Q25. Given: 


Which is true? 

A. Sum for 0 to 0 = 55 

B. Sum for 0 to 10 = 55 

C. Compilation fails due to error on line 6. 

D. Compilation fails due to error on line 7. 

E. An Exception is thrown at the runtime. 

Answer: D 

Explanation: 

Loop variables scope limited to that enclosing loop. So in this case, the scope of the loop variable x declared at line 5, limited to that for loop. Trying to access that variable at line 7, which is out of scope of the variable x, causes a compile time error. So compilation fails 

due to error at line 7. Hence option D is correct. 

Options A and B are incorrect, since code fails to compile. 

Reference: httpsy/docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html 


1z0-808 testing engine

Down to date 1z0-808 actual test:

Q26. Given the code fragment: 


Assume that the system date is June 20, 2014. What is the result? 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: A 


Q27. Given: 


What is the result? 

A. x: 1 y: 2 

B. 3 y: 4 

C. x: 0 y: 0 

D. 3 y: 4 

E. x: 1 y: 2 

F. 0 y: 0 

G. x: 0 y: 0 

H. 0 y: 0 

Answer: C 


Q28. Given: 


What is the result? 

A. 10 : 22 : 20 

B. 10 : 22 : 22 

C. 10 : 22 : 6 

D. 10 : 30 : 6 

Answer: B 


Q29. 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: E 


Q30. Given: 


What is the result? 

A. 200.0 : 100.0 

B. 400.0 : 200.0 

C. 400.0 : 100.0 

D. Compilation fails. 

Answer: C 



see more 1z0-808 dumps