posted 21 years ago
Hello, I posted a question ealier about how to generate a random value about a number. Well someone gave me some advice. SO here it is folks.
Enjoy.
use :
import java.util.Random;
int value= (int) ((new Random().nextGaussian()*20)+100 );
this code will generate values about 100 plus or minus 20.
Hence values will range from 80 to 120.
And it will do so randomly. This code can be very useful.
Hope you all find an opportunity to use it.
yours respectfully Avin Sinanan
yours respectfully<br />Avin Sinanan