EXPERTY DESIGNED 1Z0-809 PRACTICE TEST

Oracle 1Z0-809 Exam Questions
Total Questions: 469
Java SE 8 Programmer II
Updated On: Nov 10, 2025
Page : 1-47
Question 1

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?

Options :
Answer: A

Question 2

Given the code fragments:

Untitled1-page69-image83
and
Untitled1-page69-image88
What is the result?

Options :
Answer: D

Question 3

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!?

Options :
Answer: A,C

Question 4

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.         Stream stream = Stream.of("d", "cc", "bbb", "aaaa");

8.         stream.sorted().forEach(System.out::println);

9.     }

10. }

Which of the following needs to be done, so that output is: 

d

cc

bbb

aaaa

Options :
Answer: B

Question 5

Given the code fragment:

Untitled1-page69-image23
Assume that:
The required database driver is configured in the classpath.
The appropriate database is accessible with the dbURL, userName, and passWord exists
The Employee table has a column ID of type integer and the SQL query matches one record.
What is the result?

Options :
Answer: A

© Copyrights Oracledumps 2025. All Rights Reserved

We use cookies to ensure that we give you the best experience on our website (Oracledumps). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the Oracledumps.