Free Oracle 1Z0-808 Exam Braindumps (page: 12)

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



Viewing page 12 of 60
Viewing questions 45 - 48 out of 245 questions



Post your Comments and Discuss Oracle 1Z0-808 exam prep with other Community members:

1Z0-808 Exam Discussions & Posts