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

Legit 1z0-819 Exam Download

Page: 9 / 10
Total 257 questions

Java SE 11 Developer Questions and Answers

Question 33

Given:

What is the result?

Options:

A.

NullPointerException is thrown at line 4.

B.

NullPointerException is thrown at line 10.

C.

A compilation error occurs.

D.

Hello

Question 34

Given:

What is the output?

Options:

A.

300

B.

Exception

C.

200

D.

100

Question 35

A bookstore's sales are represented by a list of Sale objects populated with the name of the customer and the books they purchased.

public class Sale {

private String customer;

private List items;

// constructor, setters and getters not shown

}

public class Book {

private String name;

private double price;

// constructor, setters and getters not shown

}

Given a list of Sale objects, tList, which code fragment creates a list of total sales for each customer in ascending order?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 36

Which code is correct?

Options:

A.

Runnable r = “Message” −> System.out.println();

B.

Runnable r = () −> System.out::print;

C.

Runnable r = () -> {System.out.println(“Message”);};

D.

Runnable r = −> System.out.println(“Message”);

E.

Runnable r = {System.out.println(“Message”)};

Page: 9 / 10
Total 257 questions