Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java generate random integer in range

import java.util.concurrent.ThreadLocalRandom;

// nextInt is normally exclusive of the top value,
// so add 1 to make it inclusive
int randomNum = ThreadLocalRandom.current().nextInt(min, max + 1);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #generate #random #integer #range
ADD COMMENT
Topic
Name
7+9 =