lundi 28 juin 2021

How do I create random between 10 and 0(o and 10 not included)?

//This line of code gives random above 10 and under 20
    int randomResult =  random.nextInt(10-0 )+10 ;
    //This always gives 0
    int random result = random.nextInt(10-0);

What do I do? can you help?




Aucun commentaire:

Enregistrer un commentaire