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: Nov 12, 2024
Add To Cart
Question 1

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

1. package com.udayan.ocp;

2.  

3. class X {

4.     class Y {

5.         private void m() {

6.             System.out.println("INNER");

7.         }

8.     }

9.     

10.     public void invokeInner() {

11.         Y obj = new Y(); //Line 9

12.         obj.m(); //Line 10

13.     }

14. }

15.  

16. public class Test {

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

18.         new X().invokeInner();

19.     }

20. }


Answer: C
Question 2

Given the code fragment:
Untitled1-page69-image35
What is the result?


Answer: A
Question 3

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.util.stream.Stream;

4.  

5. public class Test {

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

7.         System.out.println(Stream.of(10, 0, -10).sorted().findAny().orElse(-1));

8.     }

9. }

Which of the following statements are true about the execution of Test class?

Select 2 options.


Answer: A,B
Question 4

Given the code fragment:
Stream<Path> files = Files.list(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: C
Question 5

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.util.ArrayDeque;

4. import java.util.Deque;

5.  

6. public class Test {

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

8.         Deque deque = new ArrayDeque<>();

9.         deque.push(new Boolean("abc"));

10.         deque.push(new Boolean("tRuE"));

11.         deque.push(new Boolean("FALSE"));

12.         deque.push(true);

13.         System.out.println(deque.pop() + ":" + deque.peek() + ":" + deque.size());

14.     }

15. }

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


Answer: A
Page:    1 / 94      
Total 469 Questions | Updated On: Nov 12, 2024
Add To Cart

© Copyrights DumpsCertify 2024. All Rights Reserved

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