January 2002
Intermediate to advanced
264 pages
8h 3m
English
java.util.Random
This class is a smaller version of the J2SE Random
class and is used as a pseudo-random number generator. The
constructor takes a long integer seed, which it uses to initialize
the random number generator. The nextInt() and
nextLong() methods can then be used to create
random numbers of the appropriate data type. The seed can be reset
using the setSeed() method.
public classRandom{ // constructors publicRandom(); publicRandom(long seed); // protected instance methods protected intnext(int bits); // public instance methods public intnextInt(); public longnextLong(); public voidsetSeed(long seed); }
Read now
Unlock full access