Генерує випадкове число за допомогою класу Java Random.
Випадковий rand = new Random ();
rand.nextInt (Math.abs ((firstChoice - secondChoice)) + 1) + Math.min (firstChoice, secondChoice);
Код на GitHub: https://github.com/amandafarrell/RandomNumberGenerator