1 package invoice; 2 3 6 public class Product { 7 private String name; 8 private char size; 9 private String color; 10 private float weight; 11 private float price; 12 13 public Product() { 14 } 15 16 public Product(String name, char size, String color, float weight, float price) { 17 this.name = name; 18 this.size = size; 19 this.color = color; 20 this.weight = weight; 21 this.price = price; 22 } 23 24 public String toString() { 25 return "name:" + name 26 + " / size:" + size 27 + " / color:" + color 28 + " / weight:" + weight 29 + " / price:" + price; 30 } 31 32 public String getName() { 33 return name; 34 } 35 36 public void setName(String name) { 37 this.name = name; 38 } 39 40 public char getSize() { 41 return size; 42 } 43 44 public void setSize(char size) { 45 this.size = size; 46 } 47 48 public String getColor() { 49 return color; 50 } 51 52 public void setColor(String color) { 53 this.color = color; 54 } 55 56 public float getWeight() { 57 return weight; 58 } 59 60 public void setWeight(float weight) { 61 this.weight = weight; 62 } 63 64 public float getPrice() { 65 return price; 66 } 67 68 public void setPrice(float price) { 69 this.price = price; 70 } 71 } 72 | Popular Tags |