Higher Test Marks with Free Online 1Z0-809 Exam Practice

Assess the CertsIQ’s updated 1Z0-809 exam questions for free online practice of your Java SE 8 Programmer II test. Our 1Z0 809 dumps questions will enhance your chances of passing the Oracle Java certification exam with higher marks.

Exam Code: 1Z0-809
Exam Questions: 469
Java SE 8 Programmer II
Updated: 04 Jun, 2025
Question 1

Given the code fragments:

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

Options :
Answer: D

Question 2

Given structure of EMPLOYEE table: 

EMPLOYEE (ID integer, FIRSTNAME varchar(100), LASTNAME varchar(100), SALARY real, PRIMARY KEY (ID)) 

EMPLOYEE table contains below records: 

1. 101 John Smith 12000

2. 102 Sean Smith 15000

3. 103 Regina Williams 15500

4. 104 Natasha George 14600

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.sql.*;

4. import java.util.Properties;

5.  

6. public class Test {

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

8.         String url = "jdbc:mysql://localhost:3306/ocp";

9.         Properties prop = new Properties();

10.         prop.put("user", "root");

11.         prop.put("password", "password");

12.         String query = "Select ID, FIRSTNAME, LASTNAME, SALARY FROM EMPLOYEE ORDER BY ID";

13.         try (Connection con = DriverManager.getConnection(url, prop);

14.              Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);

15.              ResultSet rs = stmt.executeQuery(query);)

16.         {

17.             rs.afterLast();

18.             rs.relative(-1);

19.             rs.previous();

20.             System.out.println(rs.getInt(1));

21.         }

22.     }

23. }

Also assume: 

URL, username and password are correct.

SQL query is correct and valid.

The JDBC 4.2 driver jar is configured in the classpath.

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

Options :
Answer: A

Question 3

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

Options :
Answer: B

Question 4

Given the code fragment:
Stream<Path> files = Files.walk(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?

Options :
Answer: A

Question 5

Consider the code of Greet.java file:

1. package com.udayan.ocp;

2.  

3. public final class Greet {

4.     private String msg;

5.     public Greet(String msg) {

6.         this.msg = msg;

7.     }

8.  

9.     public String getMsg() {

10.         return msg;

11.     }

12.  

13.     public void setMsg(String msg) {

14.         this.msg = msg;

15.     }

16. }

Is Greet class an immutable class?

Options :
Answer: B

Viewing Page : 1 - 47
Practicing : 1 - 5 of 469 Questions

© Copyrights CertsIQ 2025. All Rights Reserved

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