oracle 1z0-808 practice test
Java SE 8 Programmer I Exam
Last exam update: Dec 14 ,2024
Question 1
Given the code fragment:
What is the result?
-
A.
2012-02-10
-
B.
2012-01-30
-
C.
2012-02-10 00:00
-
D.
A DateTimeException is thrown at runtime.
Question 2
Given:
What is the result?
-
A.
Compilation fails.
-
B.
false true
-
C.
true false
-
D.
true true
-
E.
false false
Answer:
C
Explanation:
Question 3
Given the definitions of the MyString class and the Test class:
What is the result?
-
A.
Option A
-
B.
Option B
-
C.
Option C
-
D.
Option D
-
E.
Option E
Question 4
Given:
What is the result?
-
A.
BaseDerivedA
-
B.
BaseDerivedB
-
C.
DerivedBDerivedB
-
D.
DerivedBDerivedA
-
E.
A ClassCastException is thrown at runtime.
Question 5
Given the code fragment:
What is the result?
-
A.
Answer = 0
-
B.
Invalid calculation
-
C.
Compilation fails only at line n1.
-
D.
Compilation fails only at line n2.
-
E.
Compilation fails at line n1 and line2.
Answer:
C
Explanation:
Question 6
Given the code fragment:
Which option represents the state of the num array after successful completion of the outer loop?
A. Option A
B. Option B
C. Option C
D. Option D
Question 7
Given:
What is the result?
-
A.
AB
-
B.
AC
-
C.
CC
-
D.
A ClassCastException is thrown only at line n1.
-
E.
A ClassCastException is thrown only at line n2.
Question 8
Given the code fragment:
Which modification enables the code to print 54321?
-
A.
Replace line 6 with System.out.print (--x);
-
B.
At line 7, insert x --;
-
C.
Replace line 5 with while (is Available(--x)) {
-
D.
Replace line 12 with return (x > 0) ? false : true;
Question 9
Given:
What is the result?
-
A.
Option A
-
B.
Option B
-
C.
Option C
-
D.
Option D
Question 11
Given the code fragment:
What is the result?
-
A.
An exception is thrown at runtime.
-
B.
2014-07-31T01:01:00
-
C.
2014-07-31
-
D.
2014-09-30T00:00:00
Question 12
Given the code fragment:
What is the result?
-
A.
A B C
-
B.
A B C D E
-
C.
A B D E
-
D.
Compilation fails.
Question 13
Given the code fragment:
Which code fragment, when inserted at line n1, enables the App class to print Equal?
-
A.
Option A
-
B.
Option B
-
C.
Option C
-
D.
Option D
Question 14
Given:
What is the result?
-
A.
97 9899 100 null null null
-
B.
97 9899 100 101 102 103
-
C.
Compilation fails.
-
D.
A NullPointerException is thrown at runtime.
-
E.
An ArraylndexOutOfBoundsException is thrown at runtime.
Answer:
E
Explanation:
Question 15
Given:
What is the result?
-
A.
Option A
-
B.
Option B
-
C.
Option C
-
D.
Option D
Answer:
D
Explanation: