Free Oracle 1Z0-809 Exam Questions

Try our Free Demo Practice Tests for Comprehensive 1Z0-809 Exam Preparation

  • Oracle 1Z0-809 Exam Questions
  • Provided By: Oracle
  • Exam: Java SE 8 Programmer II
  • Certification: Oracle Java
  • Total Questions: 469
  • Updated On: Apr 27, 2025
  • Rated: 4.9 |
  • Online Users: 938
Page No. 1 of 94
Add To Cart
  • Question 1
    • Given the code fragment:
      public class FileThread implements Runnable {
       String fName;
       public FileThread(String fName) { this.fName = fName; }
       public void run () System.out.println(fName);}
       public static void main (String[] args) throws IOException,
      InterruptedException {
       ExecutorService executor = Executors.newCachedThreadPool();
       Stream<Path> listOfFiles = Files.walk(Paths.get(“Java Projects”));
       listOfFiles.forEach(line -> {
       executor.execute(new FileThread(line.getFileName().toString()));
       //
      line n1
       });
       executor.shutdown();
       executor.awaitTermination(5, TimeUnit.DAYS); //
      line n2
       }
      }
      The Java Projects directory exists and contains a list of files.
      What is the result?

      Answer: B
  • Question 2
    • Given code of Test.java file:

      1. package com.udayan.ocp;

      2.  

      3. interface Printer1 {

      4.     default void print() {

      5.         System.out.println("Printer1");

      6.     }

      7. }

      8.  

      9. class Printer2 {

      10.     public void print() {

      11.         System.out.println("Printer2");

      12.     }

      13. }

      14.  

      15. class Printer extends Printer2 implements Printer1 {

      16.  

      17. }

      18.  

      19. public class Test {

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

      21.         Printer printer = new Printer();

      22.         printer.print();

      23.     }

      24. }

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


      Answer: D
  • 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?


      Answer: B
  • Question 4
    • Given the code fragments:
      Untitled1-page69-image83
      and
      Untitled1-page69-image88
      What is the result?

      Answer: D
  • Question 5
    • Given the code fragment:
      Stream<Path> files = Files.walk(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: A
PAGE: 1 - 94
Add To Cart

© Copyrights Dumpscity 2025. All Rights Reserved

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