回答編集履歴
1
null処理の追加
answer
CHANGED
|
@@ -41,7 +41,10 @@
|
|
|
41
41
|
selected = machine3;
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
if(selected == null){
|
|
45
|
+
System.out.println("1-3の数字を入力して下さい");
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
45
48
|
selected.machine()
|
|
46
49
|
System.out.println("お金を入れてください");
|
|
47
50
|
int money = scan.nextInt();
|