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: Aug 21, 2019
Add To Cart
Question 1

Given the code fragment:
Path p1 = Paths.get(“/Pics/MyPic.jpeg”);
System.out.println (p1.getNameCount() +
 “:” + p1.getName(1) +
 “:” + p1.getFileName());
Assume that the Pics directory does NOT exist.
What is the result?


Answer: B
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

Which of the following code will create/return a Locale object for the JVM, on which your code is running?



Answer: B
Question 4

Given:
class UserException extends Exception { }
class AgeOutOfLimitException extends UserException { }
and the code fragment:
class App {
 public void doRegister(String name, int age)
 throws UserException, AgeOutOfLimitException {
 if (name.length () < 6) {
 throw new UserException ();
 } else if (age >= 60) {
 throw new AgeOutOfLimitException ();
 } else {
 System.out.println(“User is registered.”);
 }
 }
 public static void main(String[ ] args) throws UserException {
 App t = new App ();
 t.doRegister(“Mathew”, 60);
 }
}
What is the result?


Answer: B
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      
Total 469 Questions | Updated On: Aug 21, 2019
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.