Question: This question tests terminology. Consider the following class ( line numbers on the left ) : 1 public class Cart { 2 private ArrayList items;

This question tests terminology. Consider the following class (line numbers on the left):
1 public class Cart {
2 private ArrayList items;
3 private double price;
4
5 public Cart(double price, ArrayList items){
6 this.price = price;
7 this.items = items;
8}
9 public Cart(double price){
10 this.price = price;
11 this.items = new ArrayList<>();
12}
13
14 public void addItem(Item i){ items.add(i); }
15
16 public void setPrice(double d){ price = d; }
17
18 public double price(){ return price; }
19}
Match each region (one or more line numbers) to the term that most-precisely describes it.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!