Code example for Random

Methods: nextInt

0
    } 
    public static boolean randomBoolean() { 
        return random.nextBoolean();
    } 
    public static int randomInt() { 
        return random.nextInt();
    } 
    /** returns in [0,upbound) */ 
    public static int randomInt(int upbound) {
        return random.nextInt(upbound);
    } 
    /** returns the array passed in */ 
    public static byte[] randomBytes(byte[] buf) {
        random.nextBytes(buf);
        return buf;
    } 
    public static byte[] randomBytes(int length) {
        byte[] buf = new byte[length];
        return randomBytes(buf);
    }