質問編集履歴
1
内容の変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,24 +26,26 @@
|
|
26
26
|
|
27
27
|
```
|
28
28
|
|
29
|
-
連続する複数の変数に値を
|
29
|
+
連続する複数の変数を配列に格納し、その変数の中身に値を入れたい場合、for文で一気に代入することは出来ませんでしょうか?
|
30
30
|
|
31
31
|
例えば、
|
32
32
|
|
33
33
|
```java
|
34
34
|
|
35
|
+
String[] productcodearray = {productcode1_pre,productcode2_pre,productcode3_pre,productcode4_pre,productcode5_pre,productcode6_pre,
|
36
|
+
|
35
|
-
|
37
|
+
productcode7_pre,productcode8_pre,productcode9_pre,productcode10_pre};
|
36
38
|
|
37
39
|
for(int i = 0;i<11;i++) {
|
38
40
|
|
39
|
-
productcode[i]
|
41
|
+
productcodearray[i]/*この配列の要素数に格納されている変数に右辺の値を代入したい*/ = request.getParameter(sample[i]);
|
40
42
|
|
41
43
|
}
|
42
44
|
|
43
45
|
```
|
44
46
|
|
45
|
-
|
47
|
+
初歩の初歩かもしれませんがわからなくて困っています。
|
46
48
|
|
47
|
-
知恵をお貸しいただけると非常に
|
49
|
+
もしお分かりの方がいらっしゃいましたら、知恵をお貸しいただけると非常に助かります。
|
48
50
|
|
49
51
|
よろしくお願いいたします。
|