1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
-
-
- /**
- * Created by leon on 1/10/18.
- */
- public class Product {
- private double price;
- private String id;
- private int x;
- private int quantity;
- private String name;
-
- //private Map<Integer, Product> productMap;
-
- public Product(){
-
- }
-
- public Product(String id, double price, int quantity){
- this.id = id;
- this.price = price;
- this.quantity = quantity;
- }
-
- public void setPrice(double newPrice){
- price = newPrice;
- }
-
-
- public double getPrice(){
- System.out.println(price);
- return price;
- }
-
- public String setId(String newId){
- id = newId;
- System.out.println(id);
- return id;
- }
-
- public String getId(){
- System.out.println(id);
- return id;
- }
-
- public void setQuantityOfItem(int x){
- this.x = x;
- System.out.println(this.x);
- }
-
- public int getQuantityOfItem(){
- System.out.println("You have " + x + "of this item.");
- return x;
- }
- }
|