Free Oracle 1z1-809 Practice Test & Real Exam Questions

  • Exam Code/Number: 1z1-809
  • Exam Name/Title: Java SE 8 Programmer II
  • Certification Provider: Oracle
  • Corresponding Certification: Java SE
  • Exam Questions: 209
  • Updated On: Jun 02, 2026
Given the content of resources /Message.properties:
greet = Good Day!
Given the content of resources/Message_de_DE.properties:
greet = Guten Tag!
Given the code fragment from C:\src\App.java:
Correct Answer: B Vote an answer
Given the structure of the Student table:
Student (id INTEGER, name VARCHAR)
Given the records from the STUDENT table:

Given the code fragment:

Assume that:
What is the result?
Correct Answer: A Vote an answer
Given:
public class Counter {
public static void main (String[ ] args) {
int a = 10;
int b = -1;
assert (b >=1) : "Invalid Denominator";
int # = a / b;
System.out.println (c);
}
}
What is the result of running the code with the -da option?
Correct Answer: C Vote an answer
Given:

and

Which interface from the java.util.function package should you use to refactor the class Txt?
Correct Answer: D Vote an answer
Explanation: Only visible for Pass4Leader members. You can sign-up / login (it's free).
Given the code fragment:
List<Integer> values = Arrays.asList (1, 2, 3);
values.stream ()
.map(n -> n*2)//line n1
.peek(System.out::print)//line n2
.count();
What is the result?
Correct Answer: D Vote an answer
Given the code fragment:

What is the result?
Correct Answer: A Vote an answer
Which statement is true about the single abstract method of the java.util.function.Predicate interface?
Correct Answer: A Vote an answer
Explanation: Only visible for Pass4Leader members. You can sign-up / login (it's free).
Given:
public class Customer {
private String fName;
private String lName;
private static int count;
public customer (String first, String last) {fName = first, lName = last;
++count;}
static { count = 0; }
public static int getCount() {return count; }
}
public class App {
public static void main (String [] args) {
Customer c1 = new Customer("Larry", "Smith");
Customer c2 = new Customer("Pedro", "Gonzales");
Customer c3 = new Customer("Penny", "Jones");
Customer c4 = new Customer("Lars", "Svenson");
c4 = null;
c3 = c2;
System.out.println (Customer.getCount());
}
}
What is the result?
Correct Answer: B Vote an answer
Given:
Item table
* ID, INTEGER: PK
* DESCRIP, VARCHAR(100)
* PRICE, REAL
* QUANTITY< INTEGER
And given the code fragment:
9. try {
10.Connection conn = DriveManager.getConnection(dbURL, username, password);
11. String query = "Select * FROM Item WHERE ID = 110";
12. Statement stmt = conn.createStatement();
13. ResultSet rs = stmt.executeQuery(query);
14.while(rs.next()) {
15.System.out.println("ID:" + rs.getString(1));
16.System.out.println("Description:" + rs.getString(2));
17.System.out.println("Price:" + rs.getString(3));
18. System.out.println(Quantity:" + rs.getString(4));
19.}
20. } catch (SQLException se) {
21. System.out.println("Error");
22. }
Assume that:
The required database driver is configured in the classpath.
The appropriate database is accessible with the dbURL, userName, and passWord exists.
The SQL query is valid.
What is the result?
Correct Answer: B Vote an answer
Which two statements are true about synchronization and locks? (Choose two.)
Correct Answer: C,D Vote an answer
Explanation: Only visible for Pass4Leader members. You can sign-up / login (it's free).
Given the content:

Given the code fragment:

Which two code fragments when inserted at Line 1, independently, enables the code fragment to print "Hallo'?
Correct Answer: A,E Vote an answer
Given the content of /resourses/Message.properties:
welcome1="Good day!"
and given the code fragment:
Properties prop = new Properties ();
FileInputStream fis = new FileInputStream ("/resources/Message.properties"); prop.load(fis); System.out.println(prop.getProperty("welcome1")); System.out.println(prop.getProperty("welcome2", "Test"));//line n1 System.out.println(prop.getProperty("welcome3")); What is the result?
Correct Answer: B Vote an answer
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 () <= 60) {
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?
Correct Answer: B Vote an answer
Given the code fragment:
List<String> str = Arrays.asList ("my", "pen", "is", "your', "pen");
Predicate<String> test = s -> {
int i = 0;
boolean result = s.contains ("pen");
System.out.print(i++) + ":");
return result;
};
str.stream()
.filter(test)
.findFirst()
.ifPresent(System.out ::print);
What is the result?
Correct Answer: B Vote an answer
Given that course.txt is accessible and contains:
Course : : Java
and given the code fragment:
public static void main (String[ ] args) {
int i;
char c;
try (FileInputStream fis = new FileInputStream ("course.txt");
InputStreamReader isr = new InputStreamReader(fis);) {
while (isr.ready()) { //line n1
isr.skip(2);
i = isr.read ();
c = (char) i;
System.out.print(c);
}
} catch (Exception e) {
e.printStackTrace();
}
}
What is the result?
Correct Answer: B Vote an answer