1 package samples.bidbuy; 2 3 import java.math.BigDecimal ; 4 5 public class LineItem { 6 7 9 public LineItem() {}; 10 11 public LineItem(String name, int quantity, BigDecimal price) { 12 this.name=name; 13 this.quantity=quantity; 14 this.price=price; 15 } 16 17 public LineItem(String name, int quantity, String price) { 18 this.name=name; 19 this.quantity=quantity; 20 this.price=new BigDecimal (price); 21 } 22 23 25 private String name; 26 public String getName() { return name; } 27 public void setName(String value) { name=value; } 28 29 private int quantity; 30 public int getQuantity() { return quantity; } 31 public void setQuantity(int value) { quantity=value; } 32 33 private BigDecimal price; 34 public BigDecimal getPrice() { return price; } 35 public void setPrice(BigDecimal value) { price=value; } 36 37 } 38 | Popular Tags |