質問編集履歴
1
Mainクラスを追記しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -97,3 +97,35 @@
|
|
97
97
|
}
|
98
98
|
|
99
99
|
```
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
```java
|
104
|
+
|
105
|
+
public class Main {
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
public static void main(String[] args){
|
110
|
+
|
111
|
+
Goblin goblinA = new Goblin("A");
|
112
|
+
|
113
|
+
Monster goblinB = new Goblin("B");
|
114
|
+
|
115
|
+
Hero hero = new Hero();
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
int testPrint = hero.attack(goblinA);
|
120
|
+
|
121
|
+
System.out.println(testPrint);
|
122
|
+
|
123
|
+
goblinA.run();
|
124
|
+
|
125
|
+
goblinB.run();
|
126
|
+
|
127
|
+
}
|
128
|
+
|
129
|
+
}
|
130
|
+
|
131
|
+
```
|