Java Tutorial/Apache Common/RandomUtils
Random Utils
import org.apache.rumons.lang.math.RandomUtils;
public class MainClass {
public static void main(String[] args) {
//Random Value Generation
System.out.println("Random double >>> " + RandomUtils.nextDouble());
System.out.println("Random float >>> " + RandomUtils.nextFloat());
System.out.println("Random int >>> " + RandomUtils.nextInt());
}
}
Random double >>> 0.4784342304088153 Random float >>> 0.9024083 Random int >>> 268959030