jsp学习笔记(七)

package bean;
    public class CartItem {
      private String id;    //商品id
      private String name;  //商品名称
      private int quantity; //商品数量
      private double price; //商品价格
      public String getId() {
        return id;
      }
      public void setId(String id) {
        this.id = id;
      }
      public String getName() {
        return name;
      }
      public void setName(String name) {
        this.name = name;
      }
      public int getQuantity() {
        return quantity;
      }
      public void setQuantity(int quantity) {
        this.quantity = quantity;
      }
      public Double getPrice() {
        return price;
      }
      public void setPrice(double price) {
        this.price = price;
      }
      /**
      * <p>同类商品的总价<p>
      * @return 
      */
      public double totalPrice(){
        return getPrice()*getQuantity();
      }
    }

你可能感兴趣的:(jsp,bean)