-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClothing.java
More file actions
40 lines (34 loc) · 1.16 KB
/
Copy pathClothing.java
File metadata and controls
40 lines (34 loc) · 1.16 KB
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
public class Clothing extends Product{
private String size;
private String colour;
private static String category = "Clothing";
public Clothing(String productID, String productName, int numberofavailableitems, double price, String size, String colour){
super(productID,productName,numberofavailableitems,price);
this.size = size;
this.colour = colour;
}
public String getSize(){
return this.size;
}
public void setSize(String size){
this.size = size;
}
public String getColour(){
return this.colour;
}
public void setColour(){
this.colour = colour;
}
@Override
public String toString(){
return "Category : Clothing, ID : " + super.getProductID() + " , Name : " + super.getProductName() + " , No of available items : "+super.getNumberofavailableitems()+ " , Size : " + this.size + ", Price : " + super.getPrice() + ", Colour : " +this.colour;
}
@Override
public String getCategory(){
return category;
} // returns category of the product
@Override
public String getInfo(){
return (this.size + " , " + this.colour);
}
}