I try to generate random number with this code :
public class RandomInt {
private Random generator = new Random(System.currentTimeMillis());
double randomGenerator(){
return generator.nextDouble()*0.5;
}
public static void main(String[] args) {
new RandomInt();
}
}
But when run the file, it shows nothing. Help me with this please. Thank you
PS : I'm newbie
Aucun commentaire:
Enregistrer un commentaire