回答編集履歴

1

適当に

2019/08/28 08:44

投稿

tetutetu
tetutetu

スコア419

test CHANGED
@@ -91,3 +91,77 @@
91
91
 
92
92
 
93
93
  のどちらかになります。
94
+
95
+
96
+
97
+ ### こんなですかね
98
+
99
+ Main
100
+
101
+ ```java
102
+
103
+ public class Main {
104
+
105
+
106
+
107
+ public static void main(String[] args) {
108
+
109
+ DraemonPoket item = new DraemonPoket(args.length);
110
+
111
+
112
+
113
+ for(int i=0;i<args.length;i++) {
114
+
115
+ item.setItem(args[i],i);
116
+
117
+ }
118
+
119
+
120
+
121
+ item.showItem();
122
+
123
+ }
124
+
125
+ ```
126
+
127
+ DraemonPoket
128
+
129
+ ```java
130
+
131
+ public class DraemonPoket {
132
+
133
+
134
+
135
+ private String[] itemList;
136
+
137
+
138
+
139
+ public DraemonPoket(int length){
140
+
141
+ this.itemList = new String[length];
142
+
143
+ }
144
+
145
+
146
+
147
+ public void setItem(String args, int num){
148
+
149
+ this.itemList[num] =args;
150
+
151
+ }
152
+
153
+
154
+
155
+ public void showItem(){
156
+
157
+ for(String result : this.itemList){
158
+
159
+ System.out.println(result);
160
+
161
+ }
162
+
163
+ }
164
+
165
+ }
166
+
167
+ ```