I am trying to understand the Random() constructor. I understand that if I have code like:
Random rand = new Random(47);
System.out.println(rand.nextInt(10));
Then rand.nextInt(10) will generate a random number between 0 and 9, but what does the 47 being passed to the Random() constructor do? I've found some wiki's about Random as a class, but nothing that laid out how the constructor works for me. Thanks much.
Aucun commentaire:
Enregistrer un commentaire