Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EXAMPLE #1
- Random rand = new Random();
- // nextInt is normally exclusive of the top value,
- // so add 1 to make it inclusive
- int randomNum = rand.nextInt((max - min) + 1) + min;
- EXAMPLE #2
- Math.random() * (Max - Min)
- LINKS:
- http://stackoverflow.com/questions/363681/generating-random-integers-in-a-range-with-java
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement