import java.util.Random; public class testRandom { public static void main(String[] args) { Random dice= new Random (); int winner=dice.nextInt(); //get a random number, may be pos or neg multiple //digits if (winner<0)//checks for negatives winner=-winner; //change the sign if necessary winner=(winner%3)+1;//get a number between 1 and 3 System.out.println("Random number is: "+winner); } }