1z1-819 Exam Question 16

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<Book> 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?
  • 1z1-819 Exam Question 17

    Given:

    Which line of code results in a compilation error?
  • 1z1-819 Exam Question 18

    How many Thing objects are eligible for garbage collection in line 1?
  • 1z1-819 Exam Question 19

    Given:

    What is the type of the local variable x?
  • 1z1-819 Exam Question 20

    Which two safely validate inputs? (Choose two.)