Java Random sınıfını kullanarak rastgele bir sayı üretir.
Rastgele rand = yeni Rastgele ();
rand.nextInt (Math.abs ((firstChoice - secondChoice)) + 1) + Math.min (firstChoice, secondChoice);
GitHub'taki kod: https://github.com/amandafarrell/RandomNumberGenerator