If you do not like Math.Random, you can create your own Random .
import:
import java.util.Random;
code:
Random rand = new Random(); int value = rand.nextInt();
If you need other types instead of int, Random will provide methods for boolean, double, float, long, byte.
Frank source share