Oracle 1Z0-808 Exam (page: 9)
Oracle Java SE 8 Programmer I
Updated on: 01-Sep-2025

Viewing Page 9 of 49

Given:




What is the result?

  1. 6 7 8
  2. 7 8 9
  3. 0 1 2
  4. 6 8 10
  5. Compilation fails

Answer(s): A



Given the class definitions:


What is the result?

  1. Java
    Java
    Java
  2. Java
    Jeve
    va
  3. Java
    Jeve
    ve
  4. Compilation fails

Answer(s): D



Consider following interface.

Which of the following will create instance of Runnable type?

  1. Runnable run = 0 -> {System.out.println("Run");}
  2. Runnable run = 0 -> System.outprintlnfRun");
  3. Runnable run = 0 > System.outprintlnfRun");
  4. Runnable run = > System.ouLprintlnfRun"};
  5. None of the above.

Answer(s): A

Explanation:

Option A is the correct answer.
To create we have used following method with LocalDate class; public static LocalDate of(intyear, int month, intdayOfMonth) Here we need to remember that month is not zero based so if you pass 1 for month, then month will be January.
Then we have used period object of 1 day and add to date object which makes current date to next day, so final output is 2015-03-27. Hence option A is correct.



Which of the following can fill in the blank in this code to make it compile? (Select 2 options.)

  1. On line 1, fill in throws
  2. On line 1, fill in throws new
  3. On line 2, fill in throw new
  4. On line 2, fill in throws
  5. On line 2, fill in throws new

Answer(s): A,C

Explanation:

Option A and C are the correct answer.
In a method declaration, the keyword throws is used. So here at line 1 we have to use option A.
To actually throw an exception, the keyword throw is used and a new exception is created, so at line 2 we have to use throw and new keywords, which is option C. Finally it will look like;
public void method() throws Exception {
throw new Exception0;
}


Reference:

httpsy/docs.oracle.com/javase/tutorial/essential/io/fileOps.html#exception The correct answer is: On line 1, fill in throws. On line 2, fill in throw new



Given the code fragment:


What is the result?

  1. Reading Card
    Checking Card
  2. Compilation fails only at line n1.
  3. Compilation fails only at line n2.
  4. Compilation fails only at line n3.
  5. Compilation fails at both line n2 and line n3.

Answer(s): D



Viewing Page 9 of 49



Share your comments for Oracle 1Z0-808 exam with other users:

Mchal 7/20/2023 3:38:00 AM

some questions are wrongly answered but its good nonetheless
POLAND


Merry 7/30/2023 6:57:00 AM

good questions
Anonymous