or Random rnd = new Random()int number = (rnd.nextInt()) % 10 );then the number will be between 0-10;