Summer Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: dcdisc65

Page: 1 / 7
Total 62 questions
Exam Code: 1z0-809                Update: Oct 15, 2025
Exam Name: Java SE 8 Programmer II

Oracle Java SE 8 Programmer II 1z0-809 Exam Dumps: Updated Questions & Answers (October 2025)

Question # 1

Given the code fragment:

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?

A.

Compilation fails at line 14.

B.

Compilation fails at line 15.

C.

The code prints the employee ID.

D.

The code prints Error.

Question # 2

Given:

public class Emp {

String fName;

String lName;

public Emp (String fn, String ln) {

fName = fn;

lName = ln;

}

public String getfName() { return fName; }

public String getlName() { return lName; }

}

and the code fragment:

List emp = Arrays.asList (

new Emp (“John”, “Smith”),

new Emp (“Peter”, “Sam”),

new Emp (“Thomas”, “Wale”));

emp.stream()

//line n1

.collect(Collectors.toList());

Which code fragment, when inserted at line n1, sorts the employees list in descending order of fName and then ascending order of lName?

A.

.sorted (Comparator.comparing(Emp::getfName).reserved().thenComparing(Emp::getlName))

B.

.sorted (Comparator.comparing(Emp::getfName).thenComparing(Emp::getlName))

C.

.map(Emp::getfName).sorted(Comparator.reserveOrder())

D.

.map(Emp::getfName).sorted(Comparator.reserveOrder().map(Emp::getlName).reserved

Question # 3

Given:

public class Product {

int id; int price;

public Product (int id, int price) {

this.id = id;

this.price = price;

}

Public String toString () { return id + “:” + price;)

}

and the code fragment:

List products = new ArrayList <> (Arrays.asList(new Product(1, 10),

new Product (2, 30),

new Product (3, 20));

Product p = products.stream().reduce(new Product (4, 0), (p1, p2) -> {

p1.price+=p2.price;

return new Product (p1.id, p1.price);});

products.add(p);

products.stream().parallel()

.reduce((p1, p2) - > p1.price > p2.price ? p1 : p2)

.ifPresent(System.out: :println);

What is the result?

A.

4:60

B.

2:30

C.

4:602:303:201:10

D.

4:0

E.

The program prints nothing

Question # 4

Given the code fragment:

BiFunction val = (t1, t2) -> t1 + t2; //line n1

//line n2

System.out.println(val.apply(10, 10.5));

What is the result?

A.

20

B.

20.5

C.

A compilation error occurs at line n1.

D.

A compilation error occurs at line n2.

Question # 5

Given the code fragment:

ZonedDateTime depart = ZonedDateTime.of(2015, 1, 15, 3, 0, 0, 0, ZoneID.of(“UTC-7”));

ZonedDateTime arrive = ZonedDateTime.of(2015, 1, 15, 9, 0, 0, 0, ZoneID.of(“UTC-5”));

long hrs = ChronoUnit.HOURS.between(depart, arrive); //line n1

System.out.println(“Travel time is” + hrs + “hours”);

What is the result?

A.

Travel time is 4 hours

B.

Travel time is 6 hours

C.

Travel time is 8 hours

D.

An exception is thrown at line n1.

Question # 6

Given the definition of the Book class:

Which statement is true about the Book class?

A.

It demonstrates encapsulation.

B.

It is defined using the factory design pattern.

C.

It is defined using the singleton design pattern.

D.

It demonstrates polymorphism.

E.

It is an immutable class.

Question # 7

Which class definition compiles?

A.

B.

C.

D.

Question # 8

Given:

and the command:

java Product 0

What is the result?

A.

An AssertionError is thrown.

B.

A compilation error occurs at line n1.

C.

New Price: 0.0

D.

A NumberFormatException is thrown at run time.

Question # 9

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?

A.

-10

B.

0

C.

An AssertionError is thrown.

D.

A compilation error occurs.

Question # 10

Given:

and

Which interface from the java.util.function package should you use to refactor the class Txt?

A.

Consumer

B.

Predicate

C.

Supplier

D.

Function

Page: 1 / 7
Total 62 questions

Most Popular Certification Exams

Payment

       

Contact us

dumpscollection live chat

Site Secure

mcafee secure

TESTED 15 Oct 2025