This question already has an answer here:
//I want i which is generated randomly, to be >= 0 and <20 . Is the following code correct.?
int num= (int) (math.random());
If(num<20 && num >=0){
System.out.println("true");
}else{
System.out.println("false");
}
Aucun commentaire:
Enregistrer un commentaire