dimanche 7 août 2022

Android studio: how to create a random number just once?

I'm a beginner and I can't find a java tutorial, I want my application to generate sentences and some random line of code that executes only once.

Random generator = new Random();
int number = generator.nextInt(5) + 1;

switch (number) {
  case 1:
    ....
    break;
  case 2:
    ....
    break;
    ....
}



Aucun commentaire:

Enregistrer un commentaire