×

Special Offer! Limited-Time Offer! Get 25% Off on All Certification Exams – Prepare & Pass with Confidence! Use Code:  DC25OFF  

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: Jun 05, 2025
  • Rated: 4.9 |
  • Online Users: 938
Page No. 1 of 94
Add To Cart
  • Question 1
    • 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
  • 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?


      Answer: C
  • Question 3
    • F: is accessible for reading and below is the directory structure for F:

      1. F:.

      2. └───A

      3.     └───B

      4.         └───C

      5.                 Book.java

      'Book.java' file is available under 'C' directory.

      Given code of Test.java file: 

      1. package com.udayan.ocp;

      2.  

      3. import java.nio.file.Path;

      4. import java.nio.file.Paths;

      5.  

      6. public class Test {

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

      8.         Path file = Paths.get("F:\\A\\B\\Book.java");

      9.         System.out.println(file.toAbsolutePath());

      10.     }

      11. }

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


      Answer: A
  • 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
    • Consider the code of Test.java file:

      1. package com.udayan.ocp;

      2.  

      3. class Player {

      4.     String name;

      5.     int age;

      6.  

      7.     Player() {

      8.         this.name = "Yuvraj";

      9.         this.age = 36;

      10.     }

      11.  

      12.     public String toString() {

      13.         return name + ", " + age;

      14.     }

      15.     

      16.     public Class getClass() { 

      17.         return super.getClass();

      18.     }

      19. }

      20.  

      21. public class Test {

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

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

      24.     }

      25. }

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


      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.