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 the code fragment:
Stream<Path> files = Files.list(Paths.get(System.getProperty(“user.home”)));
 files.forEach (fName -> { //line n1
 try {
 Path aPath = fName.toAbsolutePath(); //line n2
 System.out.println(fName + “:”
 + Files.readAttributes(aPath,
Basic.File.Attributes.class).creationTime
());
 } catch (IOException ex) {
 ex.printStackTrace();
 });
What is the result?

Options :
Answer: C

Question 2

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 3

Given the code fragments:
class MyThread implements Runnable {
 private static AtomicInteger count = new AtomicInteger (0);
 public void run () {
 int x = count.incrementAndGet();
 System.out.print (x+” “);
 }
}
and
Thread thread1 = new Thread(new MyThread());
Thread thread2 = new Thread(new MyThread());
Thread thread3 = new Thread(new MyThread());
Thread [] ta = {thread1, thread2, thread3};
for (int x= 0; x < 3; x++) {
 ta[x].start();
}
Which statement is true?

Options :
Answer: A

Question 4

Given code of Test.java file:

package com.udayan.ocp;

 

import java.util.Arrays;

import java.util.List;

 

public class Test {

    public static void main(String[] args) {

        List list = Arrays.asList("A", "E", "I", "O");

        list.add("U");

        list.forEach(System.out::print);

    }

}

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

Options :
Answer: B

Question 5

Given:

Untitled1-page69-image37
and the code fragment:
Untitled1-page69-image36
Which two code fragments, when inserted at line n1 independently, enable the code to print
TruckCarBike?

Options :
Answer: A,D

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