title: How do I create an array with 1000 randomly generated ints?
body: <p>I am supposed to create an array of 1000 ints and write a method to find the largest int and then print it. This is what I have so far:</p>
  
  <pre><code>public static int findLargest(int[] numbers){  
      int largest = numbers[0];  
      for(int i = 1; i &lt; numbers.length; i++){  
          if(numbers[i] &gt; largest){  
              largest = numbers[i];  
          }  
      }  
      return largest;
  }
  </code></pre>
  
  <p>First, how do I create an array with 1000 randomly generated ints? I tried <code>int[] array = new (int)(Math.random());</code> but I don't know how to get it to do 1000 random numbers. Second, how do I print the result? Thanks in advance for any help.</p>