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: Jan 08, 2025
Add To Cart
Question 1

Below is the code of Test.java file:

1. package com.udayan.ocp;

2.  

3. class Outer {

4.     static class Inner {

5.         static void greetings(String s) {

6.             System.out.println(s);

7.         }

8.     }

9. }

10.  

11. public class Test {

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

13.         /*INSERT*/

14.     }

15. }

Which of the following 2 options can replace /*INSERT*/ such that there on executing class Test, output is: HELLO!?


Answer: A,C
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

You want to create a singleton class by using the Singleton design pattern. Which two statements enforce the singleton nature of the design? (Choose two.)


Answer: A,B
Question 4

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

1. package com.udayan.ocp;

2.  

3. class M {

4.     private int num1 = 100;

5.     class N {

6.         private int num2 = 200;

7.     }

8.     

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

10.         M outer = new M();

11.         M.N inner = outer.new N();

12.         System.out.println(outer.num1 + inner.num2);

13.     }

14. }


Answer: A
Question 5

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


1

and the code fragment:

2

What is the result? 


Answer: A
Page:    1 / 94      
Total 469 Questions | Updated On: Jan 08, 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.