This question already has an answer here:
- Random shuffling of an array 19 answers
I was wondering how to write the code in Java on how to randomly choose a number three times out of three choices.
For example, the 3 possible choices are 32, 54, and 173.
The first randomized choice is 54 and it is set to an int variable. The second randomized choice is 173 and it is set to another int variable. The remaining number, 32, is set to a third int variable.
Each number must be chosen once and cannot be repeated. How could I go about this? Thanks!
Aucun commentaire:
Enregistrer un commentaire