I'm working on building one of my fist apps and I'm building a Sudoku mobile game. I've built the random number generator I just cant figure out how to write it so that it only generates numbers between 1-9 (not zero) and each of numbers are only generated once. Here is what I have so far:
package randomNumber;
import java.util.Random; 
public class OneToNine {
    public static final void main(String... aArgs) {
        log ("generating random integers in range 1-9");
        Random randomGenerator = new Random();
        for (int idx = 1; idx <= 9; ++idx) {
            int randomInt = randomGenerator.nextInt(9);
            log ("Generated : " + randomInt);
        }
        log("Done. ");  
    }
    private static void log (String aMessage) {
        System.out.println(aMessage);
    }
}
 
     
     
     
    