Code example for Random

Methods: nextInt

0
    } 
 
    public int next(int max) {
        if (max <= 0)
            return 0; 
        int x = r.nextInt();
        if (x < 0)
            x = 0 - x;
        return x % (max + 1);
    } 
 
} 
Connect your IDE to all the code out there  Get Codota for Java