random class in java
import java.util.Random;
public class JavaRandomClassExample
{
public static void main(String[] args)
{
Random rand = new Random();
System.out.println(rand.nextInt(10));
System.out.println(rand.nextBoolean());
System.out.println(rand.nextDouble());
System.out.println(rand.nextFloat());
System.out.println(rand.nextGaussian());
byte[] bytes = new byte[10];
rand.nextBytes(bytes);
System.out.printf("[");
for(int a = 0; a < bytes.length; a++)
{
System.out.printf("%d ", bytes[a]);
}
System.out.printf("]\n");
System.out.println(rand.nextLong());
System.out.println(rand.nextInt());
long seed = 55;
rand.setSeed(seed);
}
}