I have an ArrayIndexOutOfBoundsExeption error can someone help me fix it please : <p>This error keeps occurring Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 131071</p>

<p>I'm trying to create an array of 131071 integers with no duplicates.</p>

<pre><code>public class array {
    public static void main(String[] args) {
        populateArray();
    }
    public static void populateArray(){
        int [] numbers = new int [131071];
        int k = 0;
        Random r = new Random();        
        for (int i = 0; i &lt; 131070 ; i++) {
            int random=r.nextInt(13071)+1;
            for (int h = 0; h &lt;= i; h++) {
                if (random != numbers[h]) {
                    numbers [k] = random;
                    k=k+1;    
                }
            }
            }                             
        for (int j = 0; j &lt; 131071; j++) {
            Arrays.sort(numbers);
            System.out.println(numbers[j]);

        }
                }

        }
</code></pre>
