私の言葉遣いが正しいかどうかはわかりません。これでより明確になることを願っています。
Integer[] Performed = new Integer[3];
public String dived(){
while (this.numberAttempts<3){
int n = this.numberAttempts;
int k = Dive.chosenRandomly();
this.Performed[n] = k ;
numberAttempts += 1;
}
return null;
}
k (乱数) の値をリストに保持して、どの数値が選択されたかがわかるようにします。while ループでリストに値を追加する方法はありますか?
[] の n を 3 未満の整数に置き換えると機能します。