EXPERTY DESIGNED 1Z0-809 PRACTICE TEST

Oracle 1Z0-809 Exam Questions
Total Questions: 469
Java SE 8 Programmer II
Updated On: Dec 07, 2025
Page : 1-47
Question 1

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.util.Arrays;

4. import java.util.List;

5. import java.util.function.Predicate;

6.  

7. public class Test {

8.     public static void main(String[] args) {

9.         List list = Arrays.asList(-80, 100, -40, 25, 200);

10.         Predicate predicate = num -> {

11.             int ctr = 1;

12.             boolean result = num > 0;

13.             System.out.print(ctr++ + ".");

14.             return result;

15.         };

16.         

17.         list.stream().filter(predicate).findFirst();

18.     }

19. }

What will be the result of compiling and executing Test class?

Options :
Answer: D

Question 2

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.time.*;

4.  

5. public class Test {

6.     public static void main(String [] args) {

7.         System.out.println(Duration.ofDays(-2));

8.     }

9. }

What will be the result of compiling and executing Test class?

Options :
Answer: D

Question 3

Given:
class UserException extends Exception { }
class AgeOutOfLimitException extends UserException { }
and the code fragment:
class App {
 public void doRegister(String name, int age)
 throws UserException, AgeOutOfLimitException {
 if (name.length () < 6) {
 throw new UserException ();
 } else if (age >= 60) {
 throw new AgeOutOfLimitException ();
 } else {
 System.out.println(“User is registered.”);
 }
 }
 public static void main(String[ ] args) throws UserException {
 App t = new App ();
 t.doRegister(“Mathew”, 60);
 }
}
What is the result?

Options :
Answer: B

Question 4

Untitled1-page69-image65

What is the result?

Options :
Answer: A

Question 5

Given the content of Operator.java, EngineOperator.java, and Engine.java files:


1

and the code fragment:

2

What is the result? 

Options :
Answer: A

© Copyrights Oracledumps 2025. All Rights Reserved

We use cookies to ensure that we give you the best experience on our website (Oracledumps). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the Oracledumps.