Index:Java 2 Standard Edition (J2SE):Java 2 JDK:Math (java.math.*)

How do I seed the random number generator?

Chat with random people around the world, auto-translating languages!

You can set the seed of the Random class manually:

This code sample is only viewable to esus.com members
Login or become a member!


ie:

This code sample is only viewable to esus.com members
Login or become a member!


outputs:

This code sample is only viewable to esus.com members
Login or become a member!


Running the app another time will yield the same pseudo-random numbers.


Further Information
Author of answer: Joris Van den Bogaert

Comments to this answer are only viewable by members. Login or become a member!