回答編集履歴
3
訂正3
test
CHANGED
@@ -88,13 +88,13 @@
|
|
88
88
|
|
89
89
|
|
90
90
|
|
91
|
-
public Dice(Object obj){ // コンストラクタ
|
91
|
+
public Dice(Object ...obj){ // コンストラクタ
|
92
92
|
|
93
93
|
for(int i = 0; i < 6; i++){
|
94
94
|
|
95
|
-
if(obj instanceof int[]){
|
95
|
+
if(obj[0] instanceof int[]){
|
96
|
-
|
96
|
+
|
97
|
-
int[] d = (int[]) obj;
|
97
|
+
int[] d = (int[]) obj[0];
|
98
98
|
|
99
99
|
_d[i] = d[i];
|
100
100
|
|
2
訂正2
test
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
int n = scan.nextInt();
|
26
26
|
|
27
|
-
|
27
|
+
int[] d = new int[6];
|
28
28
|
|
29
29
|
Dice[] dices = new Dice[n];
|
30
30
|
|
@@ -40,9 +40,9 @@
|
|
40
40
|
|
41
41
|
}
|
42
42
|
|
43
|
-
Object
|
43
|
+
Object objs = d;
|
44
|
-
|
44
|
+
|
45
|
-
dices[i] = new Dice((Object
|
45
|
+
dices[i] = new Dice((Object) objs);
|
46
46
|
|
47
47
|
}
|
48
48
|
|
@@ -88,21 +88,13 @@
|
|
88
88
|
|
89
89
|
|
90
90
|
|
91
|
-
public Dice(Object
|
91
|
+
public Dice(Object obj){ // コンストラクタ
|
92
|
-
|
93
|
-
Integer c[]=new Integer[6];
|
94
92
|
|
95
93
|
for(int i = 0; i < 6; i++){
|
96
94
|
|
97
|
-
|
98
|
-
|
99
|
-
System.out.println(obj.getClass());
|
100
|
-
|
101
|
-
if(obj instanceof
|
95
|
+
if(obj instanceof int[]){
|
102
|
-
|
103
|
-
|
104
|
-
|
96
|
+
|
105
|
-
|
97
|
+
int[] d = (int[]) obj;
|
106
98
|
|
107
99
|
_d[i] = d[i];
|
108
100
|
|
1
訂正
test
CHANGED
@@ -100,7 +100,7 @@
|
|
100
100
|
|
101
101
|
if(obj instanceof Integer[]){
|
102
102
|
|
103
|
-
|
103
|
+
|
104
104
|
|
105
105
|
Integer[] d = (Integer[])obj;
|
106
106
|
|