API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util. Random View Source
Author(s)
Frank Yellin
Since
1.0
Version
1.47, 02/07/06
Serial
Hierarchy
 Object
      Random
Implements
 Serializable
Subclasses
Description
public class Random
  An instance of this class is used to generate a stream of pseudorandom numbers.
See also:   
Constructors
public Random ()
  Creates a new random number generator.
public Random (long seed)
  Creates a new random number generator using a single long seed.
Methods
Hide/Show inherited methods
protected int next (int bits)
  Generates the next pseudorandom number.
public boolean nextBoolean ()
  Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.
public void nextBytes (byte[] bytes)
  Generates random bytes and places them into a user-supplied byte array.
public double nextDouble ()
  Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.
public float nextFloat ()
  Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.
publicsynchronized double nextGaussian ()
  Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.
public int nextInt ()
  Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.
public int nextInt (int n)
  Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.
public long nextLong ()
  Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.
publicsynchronized void setSeed (long seed)
  Sets the seed of this random number generator using a single long seed.
Fields
Hide/Show inherited fields
pack-privatefinalstatic long serialVersionUID = "3905348978240129619"
use serialVersionUID from JDK 1.1 for interoperability
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar