oracle 1z0-808 practice test

Java SE 8 Programmer I Exam


Question 1

Given the code fragment:
176/177
Questions & Answers PDF
P-

What is the result?
A. It results in a compile time error at line 18.
B. It results in a compile time error at line 9.
C. It prints : 1
D. It results in a compile time error at lines at lines 12 and 15.

Answer:

A
177/177

Discussions

Question 2

Examine:
174/177
Questions & Answers PDF
P-

Which statement is true?

  • A. The program prints m1.Accessed.
  • B. The program fails compile due to the unhandled E1 exception.
  • C. The program prints m2.Accessed.
  • D. The program fails to compile due to the unhandled E2 exception.
Answer:

B

Explanation:
175/177
Questions & Answers PDF
P-

Discussions

Question 3

Given the code fragment:

What is the result?

  • A. 1 2 3 0 01 2 3 0 0
  • B. An Exception is thrown at run time.
  • C. 1 2 3 0 01 2 3
  • D. 1 2 31 2 3
Answer:

D

Explanation:
173/177
Questions & Answers PDF
P-

Discussions

Question 4

Given:

Which action fixes the compiler error?

  • A. At line 17, add throws AccessViolationException
  • B. At line 13, add throws LogFileException
  • C. At line 2, replace throws LogFileException with throws AccessViolationException
  • D. At line 7, insert throw new LogFileException (); 172/177 Questions & Answers PDF P-
Answer:

D

Discussions

Question 5

Given the code fragment:

What is the result?

  • A. 2 : 7 : 3
  • B. 7 : 7 : 9
  • C. 2 : 7 : 0
  • D. 7 : 2 : 3
Answer:

D

Explanation:
171/177
Questions & Answers PDF
P-

Discussions

Question 6

Given the code fragment:

What is the result?

  • A. 11
  • B. 10
  • C. 12
  • D. A compile time error occurs.
Answer:

C

Explanation:
170/177
Questions & Answers PDF
P-

Discussions

Question 7

Given the code fragment:

Which two code fragments inserted at line 10 print ****?
168/177
Questions & Answers PDF
P-


  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
  • E. Option E 169/177 Questions & Answers PDF P-
Answer:

E

Discussions

Question 8

Given the definitions of the Bird class and the Peacock class:
167/177
Questions & Answers PDF
P-

and the code fragment:

Which code snippet can be inserted to print Fly.Dance. ?

  • A. Bird p = new Peacock();
  • B. Bird b = new Bird();Peacock p = (Peacock) b;
  • C. Peacock b = new Peacock ();Bird p = (Bird) b;
  • D. Bird b = new Peacock ();Peacock p = (Peacock) b;
Answer:

B

Discussions

Question 9

Given the code fragment:

Which action enables it to print AB?

  • A. Comment lines 18 to 21.
  • B. Comment line 20.
  • C. Comment line 19.
  • D. Comment line 16.
Answer:

B

Discussions

Question 10

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:

E
166/177
Questions & Answers PDF
P-

Discussions
To page 2