title: How would you make an array of 10000 with only values of 1-1000 inclusive?
body: <p>"Each   of  the functions   should  be  run with    array   inputs, of  size    100,    1000    and 10000;  where   each<br>
  value   in  any array   should  be  an  integer from    1   –   1000    inclusive. Each sorting function    should  be<br>
  run on  arrays  of  the following   types:      random  numbers,    sorted  lists   and almost  sorted  lists"</p>
  
  <p>Below I have created three arrays.</p>
  
  <p>First one fills Array of 10000 randomly with integers from 1-1000.</p>
  
  <p>Second fills array of 10000 with integers from 1-10000.
  Third Shuffles array of 10000 which include integers from 1-10000.</p>
  
  <p>My problem is I can't get my 2nd and 3rd Array of 10000 to only include values from 1-1000.
  Is is even possible? I'm new to this. Any help will be appreciated!! </p>
  
  <pre><code>int [] inputTenThousand = new int[10000];               // Random 10000
      for (int a = 0; a &lt; inputTenThousand.length; a++) {
         inputTenThousand [a] = (int) (Math.random () * 1000);
      }
  
  
  
  int [] inputTenThousand2 = new int[10000]               // Sorted 10000
      for (int a = 0; a &lt; inputTenThousand2.length; a++) {
         inputTenThousand2[a] = a + 1;
      }
  
  
  
  
  List&lt;Integer&gt; TenThousandList = new ArrayList&lt;Integer&gt;();
      for (int i = 1; i &lt; 10001; i++) {
          TenThousandList.add(i);
      }
       Collections.shuffle(TenThousandList);
  int[] inputTenThousand3 = new int[TenThousandList.size()];  // Almost Sorted 10000
      for (int i = 0; i &lt; TenThousandList.size(); i++) {
         inputTenThousand3[i] = TenThousandList.get(i);
      }
      for (int i = 0; i &lt; inputTenThousand3.length; i++) {            
         inputTenThousand3[i] = TenThousandList.get(i);   
      }
  </code></pre>