Can someone explain how this fragment of code works?
int rand = ThreadLocalRandom.current().nextInt(0,10);
switch (rand)
{
case 0: return 2;
case 1: return 1;
case 2: return 1;
default: return 0;
}
Thanks!
Aucun commentaire:
Enregistrer un commentaire