12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
-
-
- /**
- * Created by leon on 1/10/18.
- */
- public class Product {
- private double price;
- private int quantity;
- private int id;
-
- public Product(){}
-
- public Product(int id, double price, int quantity){
- this.id=id;
- this.price = price;
- this.quantity =quantity;
- }
-
- public void setPrice(double newPrice) {
- this.price = newPrice;
-
- }
-
- public double getPrice(){
- return this.price;
- }
-
- public void setQuantity(int newQuantity) {
- this.quantity = newQuantity;
-
- }
-
- public int getQuantity(){
- return quantity;
- }
-
- public void setId(int newId) {
- this.id = newId;
-
- }
-
- public int getId(){
- return this.id;
- }
-
- public String toString(){
- return Integer.toString(id) + "_ " + price + " _ " + quantity;
- }
- }
|