rss
twitter

Tuesday, May 24, 2011

Apache commons methods for generating random numbers in Java

New class is introduced in apache.commons for generating random numbers by calling a method. These methods can be accessed by importing

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

These methods can be accessed by

double rnddouble= RandomUtils.nextDouble();
float rndfloat= RandomUtils.nextFloat());
int rndfloat= RandomUtils.nextInt()); 

Bookmark and Share

0 comments:

Post a Comment

  © Blogger templates by Ourblogtemplates.com updated with zenplate.com tips

Back to TOP