jeudi 20 septembre 2018

Random number generation Java. different format

I am reading a Java file and I am confused between all these different forms of a random number generating.

Random rng = new Random();
int x = 3 + rng.nextDouble() * 5;
int x = 3 * rng.nextDouble(5);
int x = rng.nextInt(5);
int x = rng.nextInt(5) + 3;




Aucun commentaire:

Enregistrer un commentaire