Get Random long type number in Java
Description
The following code shows how to get Random long type number.
Example
//from w w w . j a va 2 s . com
import java.util.Random;
public class Main {
public static void main(String[] argv) throws Exception {
Random rand = new Random();
boolean b = rand.nextBoolean();
long l = rand.nextLong();
System.out.println(l);
}
}
The code above generates the following result.