title: Calling method wrong
body: <p>I'm learning JAVA and trying to make a program that sums and averages an arbitrary number of integers. I've made two methods for this, one that takes the number of entries:</p>
  
  <pre><code>private Scanner takeNumberOfEntries(){
      Scanner numberOfEntries = new Scanner(System.in);
      System.out.println("Number of entries:");
  
      while (!numberOfEntries.hasNextInt()){
          System.out.println("Enter the right format");
          numberOfEntries.next(); 
      }
      return numberOfEntries;
  } 
  </code></pre>
  
  <p>and passes it on to another that reads the inputs and stores them in an array:</p>
  
  <pre><code>private void summingAndAveraging(Scanner numberOfEntries){
      int entryCountLimit = numberOfEntries.nextInt();
      int[] inputArray = new int[entryCountLimit];
  
      System.out.println("Enter the integer values");
  
      for (int i = 0; i &lt; entryCountLimit ; i++){
          Scanner inputValues = new Scanner(System.in);
          while (!inputValues.hasNextInt()){
              System.out.println("fu k you, enter again:");
              inputValues.next();
          }
  
          inputArray[i] = (int) inputValues.nextInt();
      }
  
  }
  </code></pre>
  
  <p>When I try to call it in main, I get errors. I've tried both:</p>
  
  <pre><code>    takeNumberOfEntries instant = new takeNumberOfEntries();
  </code></pre>
  
  <p>and</p>
  
  <p>Scanner instantiation = new takeNumberOfEntries();</p>
  
  <p>I'm not sure what I'm doing wrong. </p>