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:
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 2

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.util.Arrays;

4. import java.util.Comparator;

5. import java.util.List;

6.  

7. public class Test {

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

9.         List list = Arrays.asList(10, 20, 8);

10.         

11.         System.out.println(list.stream().max(Comparator.comparing(a -> a)).get()); //Line 1

12.  

13.         System.out.println(list.stream().max(Integer::compareTo).get()); //Line 2

14.  

15.         System.out.println(list.stream().max(Integer::max).get()); //Line 3

16.     }

17. }

Which of the following statement is true?

Options :
Answer: C

Question 3

The last statement inside main(String []) method, increments value of i, which means it is not effectively final and hence compilation error.

//Test.java

package com.udayan.ocp;

 

class Player {

    String name;

    int age;

    Player() {

        this.name = "Virat";

        this.age = 29;

    }

    

    public int hashCode() {

        return 100;

    }

}

 

public class Test {

    public static void main(String[] args) {

        System.out.println(new Player());

    }

}

Hexadecimal representation of 100 is 64.

Which of the following option is correct?

Options :
Answer: B

Question 4

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 5

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

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