Day1第3段階完了

This commit is contained in:
m-endo
2026-09-15 15:27:33 +09:00
parent 01b47fa684
commit 6331059990
2 changed files with 34 additions and 9 deletions

View File

@@ -1,4 +1,12 @@
public class Item {
}
//フィールド宣言
String name;
int price;
int stock;
//メソッド宣言
void sell(int amount) {
this.stock = this.stock - amount;
}
}