Skip to content

Commit 7b83b6a

Browse files
committed
food class
1 parent 2fc12d9 commit 7b83b6a

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Food.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import java.util.Vector;
2+
3+
public class Food {
4+
private String name;
5+
private int price;
6+
7+
private static Vector<Food> menu = new Vector<Food>();
8+
9+
public Food(String name, int price) {
10+
this.name = name;
11+
this.price = price;
12+
13+
menu.add(this);
14+
}
15+
16+
public String getName() {
17+
return name;
18+
}
19+
20+
public int getPrice() {
21+
return price;
22+
}
23+
24+
public static Vector<Food> getMenu() {
25+
return menu;
26+
}
27+
}

0 commit comments

Comments
 (0)