Valentine Day Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: bigdisc65

Java SE 1z0-809 Book

Page: 4 / 7
Question 16

Given the code fragments:

and

What is the result?

Options:

A.

FranceOptional[NotFound]

B.

Optional [France]Optional [NotFound]

C.

Optional[France]Not Found

D.

FranceNot Found

Question 17

Given:

Which two interfaces can you use to create lambda expressions? (Choose two.)

Options:

A.

T

B.

R

C.

P

D.

S

E.

Q

F.

U

Question 18

Given the code fragment:

Which statement can be inserted into line n1 to print 1,2; 1,10; 2,20;?

Options:

A.

BiConsumer c = (i, j) -> {System.out.print (i + “,” + j+ “; “);};

B.

BiFunction c = (i, j) –> {System.out.print (i + “,” + j+ “; “)};

C.

BiConsumer c = (i, j) –> {System.out.print (i + “,” + j+ “; “)};

D.

BiConsumer c = (i, j) –> {System.out.print (i + “,” + j+ “; “);};

Question 19

Given the code fragments:

interface CourseFilter extends Predicate {

public default boolean test (String str) {

return str.contains (“Java”);

}

}

and

List strs = Arrays.asList(“Java”, “Java EE”, “Embedded Java”);

Predicate cf1 = s - > s.length() > 3;

Predicate cf2 = new CourseFilter() { //line n1

public boolean test (String s) {

return s.startsWith (“Java”);

}

};

long c = strs.stream()

.filter(cf1)

.filter(cf2//line n2

.count();

System.out.println(c);

What is the result?

Options:

A.

2

B.

3

C.

A compilation error occurs at line n1.

D.

A compilation error occurs at line n2.

Page: 4 / 7
Exam Code: 1z0-809
Exam Name: Java SE 8 Programmer II
Last Update: Feb 25, 2024
Questions: 196
1z0-809 pdf

1z0-809 PDF

$28  $80
1z0-809 Engine

1z0-809 Testing Engine

$33.25  $95
1z0-809 PDF + Engine

1z0-809 PDF + Testing Engine

$45.5  $130