New Year Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: Board70

Java SE 1z0-809 Exam Questions and Answers PDF

Page: 5 / 7
Question 20

Given the code fragment:

List empDetails = Arrays.asList(“100, Robin, HR”,

“200, Mary, AdminServices”,

“101, Peter, HR”);

empDetails.stream()

.filter(s-> s.contains(“1”))

.sorted()

.forEach(System.out::println); //line n1

What is the result?

Options:

A.

100, Robin, HR101, Peter, HR

B.

E. A compilation error occurs at line n1.

C.

100, Robin, HR101, Peter, HR200, Mary, AdminServices

D.

100, Robin, HR200, Mary, AdminServices101, Peter, HR

Question 21

Given the code fragment:

List list1 = Arrays.asList(10, 20);

List list2 = Arrays.asList(15, 30);

//line n1

Which code fragment, when inserted at line n1, prints 10 20 15 30?

Options:

A.

Stream.of(list1, list2).flatMap(list -> list.stream()).forEach(s -> System.out.print(s + “ “));

B.

Stream.of(list1, list2).flatMap(list -> list.intStream()).forEach(s -> System.out.print(s + “ “));

C.

list1.stream().flatMap(list2.stream().flatMap(e1 -> e1.stream()).forEach(s -> System.out.println(s + “ “));

D.

Stream.of(list1, list2).flatMapToInt(list -> list.stream()).forEach(s -> System.out.print(s + “ “));

Question 22

You have been asked to create a ResourceBundle which uses a properties file to localize an application.

Which code example specifies valid keys of menu1 and menu2 with values of File Menu and View Menu?

Options:

A.

File MenuView Menu

B.

menu1File Menumenu2View Menu

C.

menu1, File Menu, menu2, View Menu

D.

menu1 = File Menumenu2 = View Menu

Question 23

Given:

and the code fragment:

What is the result?

Options:

A.

A compilation error occurs at line n2.

B.

A compilation error occurs because the try block doesn’t have a catch or finally block.

C.

A compilation error occurs at line n1.

D.

The program compiles successfully.

Page: 5 / 7
Exam Code: 1z0-809
Exam Name: Java SE 8 Programmer II
Last Update: Dec 22, 2024
Questions: 196
1z0-809 pdf

1z0-809 PDF

$25.5  $84.99
1z0-809 Engine

1z0-809 Testing Engine

$28.5  $94.99
1z0-809 PDF + Engine

1z0-809 PDF + Testing Engine

$40.5  $134.99