1Z0-803 | how many questions of 1Z0-803 pdf?


Q11. Given the code fragment: 

What is the result? 

A. Found Red 

B. Found Red 

Found Blue 

C. Found Red 

Found Blue 

Found White 

D. Found Red 

Found Blue 

Found White 

Found Default 

Answer:

Q12. Given: 

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

A. Two 

B. Three 

C. Four 

D. Six 

Answer:

Q13. The protected modifier on a Field declaration within a public class means that the field 

______________. 

A. Cannot be modified 

B. Can be read but not written from outside the class 

C. Can be read and written from this class and its subclasses only within the same 

package 

D. Can be read and written from this class and its subclasses defined in any package 

Answer:

Q14. Given the code in a file Traveler.java: 

And the commands: 

Javac Traveler.java 

Java Traveler Java Duke 

What is the result? 

A. Happy Journey! Duke 

B. Happy Journey! Java 

C. An exception is thrown at runtime 

What is the result? 

D. The program fails to execute due to a runtime error 

Answer:

Q15. Given the code fragment: 

nt a = 0; 

a++; 

System.out.printIn(a++); 

System.out.printIn(a); 

What is the result? 

A. 1 2 

B. 0 1 

C. 1 1 

D. 2 2 

Answer:

Q16. Given: 

Given the code fragment: 

What is the result? 

A. 10 20 30 40 

B. 0 0 30 40 

C. Compilation fails 

D. An exception is thrown at runtime 

Answer:

Q17. A method is declared to take three arguments. A program calls this method and passes only two arguments. What is the results? 

A. Compilation fails. 

B. The third argument is given the value null. 

C. The third argument is given the value void. 

D. The third argument is given the value zero. 

E. The third argument is given the appropriate falsy value for its declared type. 

F. An exception occurs when the method attempts to access the third argument. 

Answer:

Q18. Given: 

Which two code fragments are valid? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

Answer: BC 

Q19. Give: 

What is the result? 

A. 1525 

B. 13 

C. Compilation fails 

D. An exception is thrown at runtime 

E. The program fails to execute due to runtime error 

Answer:

Q20. Given the code fragment: 

Which code fragment prints blue, cyan, ? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: