Free Oracle 1Z0-809 Exam Questions

Become Oracle Certified with updated 1Z0-809 exam questions and correct answers

Page:    1 / 94      
Total 469 Questions | Updated On: Feb 20, 2025
Add To Cart
Question 1

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

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?


Answer: A
Question 3

Given the content of Operator.java, EngineOperator.java, and Engine.java files:


1

and the code fragment:

2

What is the result? 


Answer: A
Question 4

Given:
class FuelNotAvailException extends Exception { }
class Vehicle {
 void ride() throws FuelNotAvailException { //line n1
 System.out.println(“Happy Journey!”);
 }
}
class SolarVehicle extends Vehicle {
 public void ride () throws Exception { //line n2
 super ride ();
 }
}
and the code fragment:
public static void main (String[] args) throws FuelNotAvailException, Exception
 {
 Vehicle v = new SolarVehicle ();
 v.ride();
}
Which modification enables the code fragment to print Happy Journey!?


Answer: B
Question 5

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.time.*;

4.  

5. public class Test {

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

7.         System.out.println(Duration.ofDays(-2));

8.     }

9. }

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


Answer: D
Page:    1 / 94      
Total 469 Questions | Updated On: Feb 20, 2025
Add To Cart

© Copyrights DumpsCertify 2025. All Rights Reserved

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