-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathItem.java
More file actions
33 lines (33 loc) · 796 Bytes
/
Item.java
File metadata and controls
33 lines (33 loc) · 796 Bytes
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
public class Item {
private Food food;
private int count;
private String description;
public Item(Food food, int count) {
setCount(count);
setFood(food);
description = "";
}
public Item(Food food, int count, String description) {
setCount(count);
setFood(food);
setDescription(description);
}
private void setFood(Food food) {
this.food = food;
}
private void setDescription(String description) {
this.description = description;
}
private void setCount(int count) {
this.count = count;
}
public Food getFood() {
return food;
}
public int getCount() {
return count;
}
public String getDescription() {
return description;
}
}