EXPERTY DESIGNED 1Z0-809 PRACTICE TEST

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

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.util.*;

4.  

5. public class Test {

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

7.         NavigableMap map = new TreeMap<>();

8.         map.put(25, "Pune");

9.         map.put(32, "Mumbai");

10.         map.put(11, "Sri Nagar");

11.         map.put(39, "Chennai");

12.  

13.         System.out.println(map.headMap(25, true));

14.     }

15. }

Options :
Answer: C

Question 2

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 3

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.util.stream.Stream;

4.  

5. public class Test {

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

7.         System.out.println(Stream.of(10, 0, -10).sorted().findAny().orElse(-1));

8.     }

9. }

Which of the following statements are true about the execution of Test class?

Select 2 options.

Options :
Answer: A,B

Question 4

Given the code fragment:
Path p1 = Paths.get(“/Pics/MyPic.jpeg”);
System.out.println (p1.getNameCount() +
 “:” + p1.getName(1) +
 “:” + p1.getFileName());
Assume that the Pics directory does NOT exist.
What is the result?

Options :
Answer: B

Question 5

Given the code fragment:

Untitled1-page69-image118
Assume that:
 The required database driver is configured in the classpath.
 The appropriate database is accessible with the dbURL, userName, and passWord exists.
 The Employee and Customer tables are available and each table has id column with a few records and
the SQL queries are valid.
What is the result of compiling and executing this code fragment?

Options :
Answer: C

© 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.