title: Generate 10 Random Integers storing them in an Array and then calling a Method to display the Array
body: <p>so i need to generate 10 random integers in the range 1-20 but i have to store them in an array
  called numbers. Then I have to call a method called displayArray which displays the contents of the
  array and for the assignment i have to use a for loop to traverse the array.</p>
  
  <p>The method header for the displayArray method is:</p>
  
  <pre><code>public static void displayArray(int[] array)
  </code></pre>
  
  <p>This is what I have done</p>
  
  <pre><code>public class RandomIntegers {
  
      static int numbers = 0;
  
      public static void displayArray(int[] array) {
           System.out.println(numbers + "Numbers Generated");
      }
  
  }//end class
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public class Random_Integers{
  
      public static void main(String[] args) {
  
          RandomIntegers[] numbers = new RandomIntegers[10];
  
          //Generates 10 Random Numbers in the range 1 -20
          for(int i = 0; i &lt; numbers.length; i++) {
            numbers[i] = (int)(Math.random() * 20);
  
              RandomIntegers Numbers = new RandomIntegers();
  
              numbers[i] = Numbers;
  
          }//end for loop
  
          for (int i = 0; i &lt; numbers.length; i++) {
              numbers Numbers = numbers[i];       
  
              Numbers[i].displayArray;        
              System.out.println();
  
          }//end for loop
    }//end main method
  }//end class
  </code></pre>
  
  <p>An error appears on the lines</p>
  
  <p>Type mismatch cannot convert from int to RnadomIntegers</p>
  
  <pre><code>numbers[i] = (int)(Math.random() * 20);
  </code></pre>
  
  <p>numbers cannot be resolved to a type</p>
  
  <pre><code>numbers Numbers = numbers[i];
  </code></pre>
  
  <p>Syntax error enter 'AssignmentOperator Expression' to complete expression</p>
  
  <pre><code>Numbers[i].displayArray;
  </code></pre>
  
  <p>I realize I need to assign an instance of the RandomIntegers class to the slot in the array to fix the first problem but i don't know how, could someone show me how do to so</p>
  
  <p>and i don't know how to fix the other 2 problems i'm only learning how to use java so could someone please guide me in the right direction</p>