Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java random

import java.util.Random;
//If there is a need to reproduce the same sequence of random numbers, 
//we have to specify a seed to the constructor, like 100000
Random random = new Random(100000);    //using a seed
System.out.println(random.nextInt(5)); // print one random 0, 1, 2, 3, 4
System.out.println(random.nextInt(5)); 
Source by coders911.org #
 
PREVIOUS NEXT
Tagged: #java #random
ADD COMMENT
Topic
Name
6+1 =