<< Prev Question

Question 61/61

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?

LEAVE A REPLY

Your email address will not be published. Required fields are marked *

Question List (61q)
Question 1: Given: (Exhibit) Which two allow a.Main to allocate a new Pe...
1 commentQuestion 2: Given the code fragment: Path currentFile = Paths.get("/scra...
Question 3: Given: (Exhibit) What is the result?...
Question 4: Given the code fragment: (Exhibit) What is the result?...
Question 5: Given: (Exhibit) What is the output?...
Question 6: Given: (Exhibit) Which is true about line 1?...
Question 7: Given: (Exhibit) What is the output?...
Question 8: Given: (Exhibit) What is the result?...
Question 9: Given: (Exhibit) When is the readObject method called?...
Question 10: Given: String originalPath = "data\\projects\\a-project\\..\...
1 commentQuestion 11: Given the code fragment: var pool = Executors.newFixedThread...
Question 12: Which is the correct order of possible statements in the str...
Question 13: Given: (Exhibit) Which statement is true?...
1 commentQuestion 14: Given: var fruits = List.of("apple", "orange", "banana", "le...
1 commentQuestion 15: Given: (Exhibit) Which three are true? (Choose three.)...
Question 16: Given: (Exhibit) What is the result?...
Question 17: Given: (Exhibit) What is the result?...
Question 18: Which two statements independently compile? (Choose two.)...
Question 19: Which two statements are true about the modular JDK? (Choose...
Question 20: Given: (Exhibit) What is the result?...
Question 21: Given: (Exhibit) What is the result?...
Question 22: Assuming the Widget class has a getPrice method, this code d...
Question 23: Given an application with a main module that has this module...
Question 24: Given: (Exhibit) What is the output?...
1 commentQuestion 25: Given: (Exhibit) Which code, when inserted at one or more ma...
Question 26: Given: (Exhibit) Which two are correct? (Choose two.)...
Question 27: Consider this method declaration: (Exhibit) A) "SET SESSION ...
Question 28: Given: (Exhibit) And the command: java Main Helloworld What ...
Question 29: Given: (Exhibit) What is the result?...
Question 30: Given: (Exhibit) What is the result?...
1 commentQuestion 31: Given: (Exhibit) and (Exhibit) What is the result?...
Question 32: Given the code fragment: (Exhibit) What is the result?...
Question 33: Given: (Exhibit) It is required that if p instanceof Pair th...
Question 34: Given the code fragment: (Exhibit) Which "for" loop produces...
Question 35: Given: (Exhibit) Which expression when added at line 1 will ...
Question 36: Given: (Exhibit) Which three classes successfully override p...
Question 37: Given the declaration: (Exhibit) Examine this code fragment:...
Question 38: Given: (Exhibit) and omitting the throws FooException clause...
Question 39: Given: (Exhibit) Which two methods facilitate valid ways to ...
Question 40: Given: (Exhibit) Which is true?...
Question 41: Which two commands are used to identify class and module dep...
Question 42: Given: (Exhibit) What is the result?...
3 commentQuestion 43: Given: (Exhibit) executed using command: java Hello "Hello W...
1 commentQuestion 44: Given: (Exhibit) Which two independent changes will make the...
Question 45: Given: (Exhibit) Which two constructors will compile and set...
Question 46: Given: (Exhibit) What is the expected result of javac?...
1 commentQuestion 47: Given: LocalDate d1 = LocalDate.of(1997,2,7); DateTimeFormat...
1 commentQuestion 48: Given: (Exhibit) What is the result?...
2 commentQuestion 49: Given: (Exhibit) Which two lines of code when inserted in li...
Question 50: Given: (Exhibit) What is the result?...
1 commentQuestion 51: Given: (Exhibit) When run and all three files exist, what is...
Question 52: Given: List&lt;String&gt; list1 = new ArrayList&lt;&gt;(); l...
Question 53: Analyze the code: (Exhibit) Which two options can you insert...
1 commentQuestion 54: Given: (Exhibit) What is the result?...
Question 55: Given: (Exhibit) Which is true?...
1 commentQuestion 56: Given: (Exhibit) Which annotation should be used to remove w...
Question 57: Which three guidelines are used to protect confidential info...
Question 58: Given: (Exhibit) Which statement is equivalent to line 1?...
Question 59: Given this requirement: Module vehicle depends on module par...
Question 60: Given: (Exhibit) What is the result?...
Question 61: A bookstore's sales are represented by a list of Sale object...