302341CE5371968C6E29FD33D6E5E7D9
1z0-808
Java SE 8 Programmer I
302341CE5371968C6E29FD33D6E5E7D9
Exam A
QUESTION 1
Given:
What is the result?
A.200.0 : 100.0
B.400.0 : 200.0
C.400.0 : 100.0
D.Compilation fails.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 2
Which statement is true about the switch statement?
A.It must contain the default section.
B.The break statement, at the end of each case block, is optional.
C.Its case label literals can be changed at runtime.
D.Its expression must evaluate to a collection of values.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 3
Given the code fragment:
302341CE5371968C6E29FD33D6E5E7D9
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.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 4
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.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 5
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
302341CE5371968C6E29FD33D6E5E7D9
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Using the private modifier is the main way that an object encapsulates itself and hide data from the outside
world.
Reference: http://www.tutorialspoint.com/java/java_access_modifiers.htm
QUESTION 6
Given the code fragment:
Which two modifications, made independently, enable the code to compile? (Choose two.)
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.
Correct Answer: CD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 7
Given:
302341CE5371968C6E29FD33D6E5E7D9
And given the code fragment:
What is the result?
A.
4W 100 Auto
4W 150 Manual
B.
null 0 Auto
4W 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
Correct Answer: E
Section: (none)
Explanation
Explanation/Reference:
QUESTION 8
Given:
评论0