Free Oracle 1Z0-809 Exam Questions

Absolute Free 1Z0-809 Exam Practice for Comprehensive Preparation 

  • Oracle 1Z0-809 Exam Questions
  • Provided By: Oracle
  • Exam: Java SE 8 Programmer II
  • Certification: Oracle Java
  • Total Questions: 469
  • Updated On: May 21, 2026
  • Rated: 4.9 |
  • Online Users: 938
Page No. 1 of 94
Add To Cart
  • Question 1
    • 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. }


      Answer: A
  • Question 2
    • You want to create a singleton class by using the Singleton design pattern. Which two statements enforce the singleton nature of the design? (Choose two.)

      Answer: A,B
  • Question 3
    • 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. class Person {

      8.     private String firstName;

      9.     private String lastName;

      10.  

      11.     public Person(String firstName, String lastName) {

      12.         this.firstName = firstName;

      13.         this.lastName = lastName;

      14.     }

      15.  

      16.     public String getFirstName() {

      17.         return firstName;

      18.     }

      19.  

      20.     public String getLastName() {

      21.         return lastName;

      22.     }

      23.  

      24.     public String toString() {

      25.         return "{" + firstName + ", " + lastName + "}";

      26.     }

      27. }

      28.  

      29. public class Test {

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

      31.         List list = Arrays.asList(

      32.                 new Person("Tom", "Riddle"),

      33.                 new Person("Tom", "Hanks"),

      34.                 new Person("Yusuf", "Pathan"));

      35.         list.stream().sorted(Comparator.comparing(Person::getFirstName).reversed()

      36.                 .thenComparing(Person::getLastName)).forEach(System.out::println);

      37.     }

      38. }

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


      Answer: A
  • Question 4
    • 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?

      Answer: C
  • Question 5
    • Given the code fragment:
      9. Connection conn = DriveManager.getConnection(dbURL, userName, passWord);
      10. String query = “SELECT id FROM Employee”;
      11. try (Statement stmt = conn.createStatement()) {
      12. ResultSet rs = stmt.executeQuery(query);
      13. stmt.executeQuery(“SELECT id FROM Customer”);
      14. while (rs.next()) {
      15. //process the results
      16. System.out.println(“Employee ID: “+ rs.getInt(“id”));
      17. }
      18. } catch (Exception e) {
      19. System.out.println (“Error”);
      20. }
      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?


      Answer: C
PAGE: 1 - 94
Add To Cart

© Copyrights DumpsEngine 2026. All Rights Reserved

We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the DumpsEngine.