これはじゃんけんゲームです。私の質問は、weapons.length をプライベート Random r = new Random(weapons.length); に移動した場合です。それは私にエラーを与えるでしょう。メソッド内でweapons.lengthを移動すると、正常に実行されます。違いはなんですか?
 public class Game {
private String[] weapons = {"rock", "paper", "scissor"};
private Random r = new Random(weapons.length);
public void thePick() {
    System.out.println(weapons[r.nextInt()]);
 }
}
対
public class Game {
private String[] weapons = {"rock", "paper", "scissor"};
private Random r = new Random();
public void thePick() {
    System.out.println(weapons[r.nextInt(weapons.length)]);
 }
}