Java SE 8 Programmer I 1Z0-808 Exam Guide

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 Given the code fragment: What is the result if the integer aVar is 9? A. 10 Hello World! B. Hello Universe! C. Hello World! D. Compilation fails. Answer: A Given the code fragment: […]

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

Given the code fragment:

What is the result if the integer aVar is 9?
A. 10 Hello World!
B. Hello Universe!
C. Hello World!
D. Compilation fails.
Answer: A

Given the code fragment:

What is the result?
A. May 04, 2014T00:00:00.000
B. 2014-05-04T00:00: 00. 000
C. 5/4/14T00:00:00.000
D. An exception is thrown at runtime.
Answer: D

Given the code fragment:

What is the result?
A. Sum is 600
B. Compilation fails at line n1.
C. Compilation fails at line n2.
D. A ClassCastException is thrown at line n1.
E. A ClassCastException is thrown at line n2.
Answer: C

What is the name of the Java concept that uses access modifiers to protect variables and hide them within a class?
A. Encapsulation
B. Inheritance
C. Abstraction
D. Instantiation
E. Polymorphism
Answer: A

Given the code fragment:

Which two modifications, made independently, enable the code to compile?
A. Make the method at line n1 public.
B. Make the method at line n2 public.
C. Make the method at line n3 public.
D. Make the method at line n3 protected.
E. Make the method at line n4 public.
Answer: C,D

Given:

And given the code fragment:

What is the result?
A. 4W 100 Auto4W 150 Manual
B. Null 0 Auto4W 150 Manual
C. Compilation fails only at line n1
D. Compilation fails only at line n2
E. Compilation fails at both line n1 and line n2
Answer: C

fragment:

Which two modifications should you make so that the code compiles successfully?

A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: A,C

 

Author: admin

See all posts by (2896)

Leave a Reply