Source of Product.java


  1: /**
  2:    A product with a price and description.
  3: */
  4: public class Product implements LineItem
  5: {
  6:    /**
  7:       Constructs a product.
  8:       @param description the description
  9:       @param price the price
 10:    */
 11:    public Product(String description, double price)
 12:    {
 13:       this.description = description;
 14:       this.price = price;
 15:    }
 16:    public double getPrice() { return price; }
 17:    public String toString() { return description; }
 18:    private String description;
 19:    private double price;
 20: }