質問編集履歴
1
前項の問題を解けた上で、そのコードも使うという流れのようでしたので追記してそのコードを載せます。
title
CHANGED
File without changes
|
body
CHANGED
@@ -27,4 +27,29 @@
|
|
27
27
|
System.out.println(baseHp + ":" + t.hp);
|
28
28
|
}
|
29
29
|
}
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
//追記分
|
34
|
+
public class Thief {
|
35
|
+
String name;
|
36
|
+
int hp;
|
37
|
+
int mp;
|
38
|
+
|
39
|
+
public Thief(String name, int hp, int mp){
|
40
|
+
this.name = name;
|
41
|
+
this.hp = hp;
|
42
|
+
this.mp = mp;
|
43
|
+
}
|
44
|
+
public Thief(String name, int hp){
|
45
|
+
this(name,hp,5);
|
46
|
+
//this.mp = 5;
|
47
|
+
}
|
48
|
+
public Thief(String name){
|
49
|
+
this(name,40);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
```ここに言語を入力
|
53
|
+
|
54
|
+
コード
|
30
55
|
```
|