EXPERTY DESIGNED 1Z0-809 PRACTICE TEST

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

Given the code fragment:
List<String> colors = Arrays.asList(“red”, “green”, “yellow”);
Predicate<String> test = n - > {
 System.out.println(“Searching…”);
 return n.contains(“red”);
};
colors.stream()
 .filter(c -> c.length() >= 3)
 .allMatch(test);
What is the result?

Options :
Answer: C

Question 2

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

1. package com.udayan.ocp;

2.  

3. class M {

4.     private int num1 = 100;

5.     class N {

6.         private int num2 = 200;

7.     }

8.     

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

10.         M outer = new M();

11.         M.N inner = outer.new N();

12.         System.out.println(outer.num1 + inner.num2);

13.     }

14. }

Options :
Answer: A

Question 3

Given the code fragment:
List<String> empDetails = Arrays.asList(“100, Robin, HR”,
 “200, Mary, AdminServices”,
 “101, Peter, HR”);
empDetails.stream()
 .filter(s-> s.contains(“1”))
 .sorted()
 .forEach(System.out::println); //line n1
What is the result?

Options :
Answer: A

Question 4

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. public class Test {

4.     private static void div(int i, int j) {

5.         try {

6.             System.out.println(i / j);

7.         } catch(ArithmeticException e) {

8.             throw (RuntimeException)e;

9.         }

10.     }

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

12.         try {

13.             div(5, 0);

14.         } catch(ArithmeticException e) {

15.             System.out.println("AE");

16.         } catch(RuntimeException e) {

17.             System.out.println("RE");

18.         }

19.     }

20. }

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

Options :
Answer: A

Question 5

Given the code fragment:
Untitled1-page69-image35
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.