How to check ensure a array does not contain the same element twice
<p>I have a loop which assigns randomly generated integers into an array.
I need a way to ensure the same integer is not input into the array twice.</p>

<p>I figured creating a loop inside the overall loop would work but I am unsure on what to execute here.</p>

<pre><code>int wwe[] = new int[9];
for(int i = 0; i &lt; 9 ; i++){
    int randomIndex = generator.nextInt(wwe.length);
    wwe[i] = randomIndex;

    System.out.println(wwe[i]);
    System.out.println("########");
    for(int j = 0; j &lt; 9; j++){
        System.out.println("This is the inner element " + wwe[j]);
    }
}
</code></pre>
