-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConsumable.java
More file actions
44 lines (41 loc) · 1.19 KB
/
Consumable.java
File metadata and controls
44 lines (41 loc) · 1.19 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
41
42
43
44
package Assignment4;
public class Consumable extends Item {
private String food;
private String medicine;
private String isWeed;
public Consumable(String name, double weight, double value, double ID, double Durability, String food, String medicine, String isWeed) {
super(name, weight, value, ID, Durability);
this.food = food;
this.medicine = medicine;
this.isWeed = isWeed;
}
public String isFood() {
return food;
}
public void setFood(String food) {
this.food = food;
}
public String isMedicine() {
return medicine;
}
public void setMedicine(String medicine) {
this.medicine = medicine;
}
public String getIsWeed() {
return isWeed;
}
public void setIsWeed(String isWeed) {
this.isWeed = isWeed;
}
@Override
public String toString() {
return ("Name: | "+this.getName()+
" | ID: "+ this.getID() +
" | Weight: "+ this.getWeight()+
" | Value: " + this.getValue()+
" | Durability: " + this.getDurability()+
" | Is Food: " + this.isFood()+
" | Is Medicine: " + this.isMedicine()+
" | Is Weed: " + this.getIsWeed() + " |");
}
}