-
Notifications
You must be signed in to change notification settings - Fork 0
/
Product.java
58 lines (51 loc) · 1.38 KB
/
Product.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* This class contains information of products in store.
*
* @author Liu
* @version 1
*/
public class Product
{
// instance variables - replace the example below with your own
public String pname;
public String category;
public int price;
public String provider;
public String stock;
public int shelflife;
public int arriveDate;
/**
* Constructor for objects of class Product
*/
public Product()
{
// initialise instance variables
this.pname = "";
this.category = "";
this.price = 0;
this.provider = "";
this.stock = "";
this.shelflife = 0;
this.arriveDate = 2000/01/01;
}
public Product(String name, String category, int price, String provider, String stock, int shelflife)
{
this.pname = pname;
this.category = category;
this.price = price;
this.provider = provider;
this.stock = stock;
this.shelflife = shelflife;
this.arriveDate = arriveDate;
}
public Product(Product product)
{
this.pname = product.pname;
this.category = product.category;
this.price = product.price;
this.provider = product.provider;
this.stock = product.stock;
this.shelflife = product.shelflife;
this.arriveDate = product.arriveDate;
}
}