RandomUtils.nextFloat() : RandomUtils « org.apache.commons.math « Java by API





RandomUtils.nextFloat()

/*
Random double >>> 0.9454382405994292
Random float >>> 0.21482907
Random int >>> 1521164877

 */
import org.apache.commons.lang.math.RandomUtils;

public class MathUtilsTrial {
  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());

  }
}

           
       










Apache-Common-Lang.zip( 248 k)

Related examples in the same category

1.RandomUtils.nextDouble()
2.RandomUtils.nextInt()