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: Nov 26, 2025
  • Rated: 4.9 |
  • Online Users: 938
Page No. 1 of 94
Add To Cart
  • Question 1
    • Given code of Test.java file: 

      1. package com.udayan.ocp;

      2.  

      3. import java.util.List;

      4. import java.util.Map;

      5. import java.util.stream.Collectors;

      6. import java.util.stream.Stream;

      7.  

      8. class Certification {

      9.     String studId;

      10.     String test;

      11.     int marks;

      12.  

      13.     Certification(String studId, String test, int marks) {

      14.         this.studId = studId;

      15.         this.test = test;

      16.         this.marks = marks;

      17.     }

      18.  

      19.     public String toString() {

      20.         return "{" + studId + ", " + test + ", " + marks + "}";

      21.     }

      22.  

      23.     public String getStudId() {

      24.         return studId;

      25.     }

      26.  

      27.     public String getTest() {

      28.         return test;

      29.     }

      30.  

      31.     public int getMarks() {

      32.         return marks;

      33.     }

      34. }

      35.  

      36. public class Test {

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

      38.         Certification c1 = new Certification("S001", "OCA", 87);

      39.         Certification c2 = new Certification("S002", "OCA", 82);

      40.         Certification c3 = new Certification("S001", "OCP", 79);

      41.         Certification c4 = new Certification("S002", "OCP", 89);

      42.         Certification c5 = new Certification("S003", "OCA", 60);

      43.         Certification c6 = new Certification("S004", "OCA", 88);

      44.  

      45.         Stream stream = Stream.of(c1, c2, c3, c4, c5, c6);

      46.         Map> map =

      47.                 stream.collect(Collectors.partitioningBy(s -> s.equals("OCA")));

      48.         System.out.println(map.get(true));

      49.     }

      50. }

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


      Answer: A
  • Question 2
    • Below is the code of Test.java file:

      1. package com.udayan.ocp;

      2.  

      3. class Outer {

      4.     static class Inner {

      5.         static void greetings(String s) {

      6.             System.out.println(s);

      7.         }

      8.     }

      9. }

      10.  

      11. public class Test {

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

      13.         /*INSERT*/

      14.     }

      15. }

      Which of the following 2 options can replace /*INSERT*/ such that there on executing class Test, output is: HELLO!?


      Answer: A,C
  • Question 3
    • 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
  • 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?


      Answer: A
  • Question 5
    • 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. }


      Answer: C
PAGE: 1 - 94
Add To Cart

© Copyrights DumpsEngine 2025. All Rights Reserved

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