質問編集履歴
3
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -100,7 +100,7 @@
|
|
100
100
|
|
101
101
|
|
102
102
|
|
103
|
-
|
103
|
+
|
104
104
|
|
105
105
|
|
106
106
|
|
2
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,7 +18,13 @@
|
|
18
18
|
|
19
19
|
### 発生している問題・エラーメッセージ
|
20
20
|
|
21
|
+
実行結果
|
21
22
|
|
23
|
+
体積:0
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
### 該当のソースコード
|
22
28
|
|
23
29
|
```
|
24
30
|
|
@@ -84,9 +90,7 @@
|
|
84
90
|
|
85
91
|
|
86
92
|
|
87
|
-
実行結果
|
88
93
|
|
89
|
-
体積:0
|
90
94
|
|
91
95
|
|
92
96
|
|
@@ -98,65 +102,7 @@
|
|
98
102
|
|
99
103
|
### 該当のソースコード
|
100
104
|
|
101
|
-
package study;
|
102
105
|
|
103
|
-
class Square {
|
104
|
-
|
105
|
-
int side1;
|
106
|
-
|
107
|
-
int side2;
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
Square(int side1, int side2) {
|
112
|
-
|
113
|
-
this.side1 = side1;
|
114
|
-
|
115
|
-
this.side2 = side2;
|
116
|
-
|
117
|
-
}
|
118
|
-
|
119
|
-
int compute() {
|
120
|
-
|
121
|
-
return side1 * side2;
|
122
|
-
|
123
|
-
}
|
124
|
-
|
125
|
-
}
|
126
|
-
|
127
|
-
class Cube extends Square{
|
128
|
-
|
129
|
-
int side3;
|
130
|
-
|
131
|
-
Cube(int side1, int side2,int side3){
|
132
|
-
|
133
|
-
super(side1, side2);
|
134
|
-
|
135
|
-
}
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
int compute() {
|
140
|
-
|
141
|
-
return super.compute() * side3;
|
142
|
-
|
143
|
-
}
|
144
|
-
|
145
|
-
}
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
public class CubeMain {
|
150
|
-
|
151
|
-
public static void main(String[] args) {
|
152
|
-
|
153
|
-
Cube obj = new Cube(2, 3, 4);
|
154
|
-
|
155
|
-
System.out.println("体積:" + obj.compute());
|
156
|
-
|
157
|
-
}
|
158
|
-
|
159
|
-
}
|
160
106
|
|
161
107
|
|
162
108
|
|
1
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,75 @@
|
|
22
22
|
|
23
23
|
```
|
24
24
|
|
25
|
+
package study;
|
26
|
+
|
27
|
+
class Square {
|
28
|
+
|
29
|
+
int side1;
|
30
|
+
|
31
|
+
int side2;
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
Square(int side1, int side2) {
|
36
|
+
|
37
|
+
this.side1 = side1;
|
38
|
+
|
39
|
+
this.side2 = side2;
|
40
|
+
|
41
|
+
}
|
42
|
+
|
43
|
+
int compute() {
|
44
|
+
|
45
|
+
return side1 * side2;
|
46
|
+
|
47
|
+
}
|
48
|
+
|
49
|
+
}
|
50
|
+
|
51
|
+
class Cube extends Square{
|
52
|
+
|
53
|
+
int side3;
|
54
|
+
|
55
|
+
Cube(int side1, int side2,int side3){
|
56
|
+
|
57
|
+
super(side1, side2);
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
int compute() {
|
64
|
+
|
65
|
+
return super.compute() * side3;
|
66
|
+
|
67
|
+
}
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
|
25
|
-
|
73
|
+
public class CubeMain {
|
74
|
+
|
75
|
+
public static void main(String[] args) {
|
76
|
+
|
77
|
+
Cube obj = new Cube(2, 3, 4);
|
78
|
+
|
79
|
+
System.out.println("体積:" + obj.compute());
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
実行結果
|
88
|
+
|
89
|
+
体積:0
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
26
94
|
|
27
95
|
```
|
28
96
|
|