mercredi 17 février 2016

How Java random generator works?

I wrote program that simulates dice roll

    Random r = new Random();
    int result = r.nextInt(6);
    System.out.println(result);

I want to know if there is a way to "predict" next generated number and how JVM determines what number to generate next?

Will my code output numbers close to real random at any JVM and OS?




Aucun commentaire:

Enregistrer un commentaire