Day1第3段階完了
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
|
||||
public class Item {
|
||||
|
||||
}
|
||||
//フィールド宣言
|
||||
String name;
|
||||
int price;
|
||||
int stock;
|
||||
|
||||
//メソッド宣言
|
||||
void sell(int amount) {
|
||||
this.stock = this.stock - amount;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user