Question 1

Given:

What code inserted into class C would allow it to compile?
  • Question 2

    Given these two classes:


    And given this fragment:

    Which describes the fragment?
  • Question 3

    Given:

    And the command:
    java Main Helloworld
    What is the result ?
  • Question 4

    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?
  • Question 5

    Given the code fragment:
    Which two code snippets inserted independently inside println method print Mondial:domainmodel? (Choose two.)