title: Populate ArrayList in constructor with scanner input -Java
body: <p>I'm working on a programming project and I have a little knowledge of Java. I can't seem to figure out what this professor is looking for.</p>
  
  <p>You will create a Java class called <code>ArrayWorks</code>. The constructor will ask the user how many numbers they are entering, then retrieving those numbers from the user. The numbers will be placed into an <code>ArrayList</code> created by the constructor. The <code>ArrayList</code> is the lone attribute of the
  <code>ArrayWorks</code> class. </p>
  
  <p>You will then write following methods:</p>
  
  <ol>
  <li>size : This method returns the size of the ArrayList attribute</li>
  <li>ave : This method calculates and returns the average of the numbers on the array. Note
  that the average will not ALWAYS be a whole number, so use an appropriate return type.</li>
  <li>Max : Returns the highest value on the array</li>
  <li>Min : Returns the lowest value on the array</li>
  </ol>
  
  <p>What I got:</p>
  
  <pre><code>import java.util.*;
  
  public class ArrayWorks{
  
  ArrayWorks (int inputs, ArrayList&lt;Integer&gt; nums){
  this.inputs = inputs;
  this.nums = nums;
  }  
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      ArrayList&lt;Integer&gt; nums = new ArrayList&lt;Integer&gt;();
      System.out.println("please enter how many numbers you have to enter!");
      int numOfInputs = sc.nextInt();
      System.out.println("Now enter the numbers!");
      for(int i = numOfInputs; i&gt;0; i--){
        nums.add(sc.nextInt());
      }
    }
    int inputs;
    ArrayList&lt;Integer&gt; nums;
    int size;
    int max;
    int min;
    double ave;
  
  
    public int getSize(){
      size = nums.size();
      return size;
    }
  
    public double ave(){
      int sum = 0;
      for (Integer i : nums) { 
        sum += i;
      }
  
      double average = sum / nums.size();
  
      return average;
    }
  
    public int max(){
      for(Integer i: nums) {
      if(i &gt; max) max = i;
  }
      return max;
    }
  
    public int min(){
      for(Integer i: nums) {
      if(i &lt; min) min = i;
  }
      return min;
    }
  
  }
  </code></pre>
  
  <p>problem being I don't know how I can satisfy his need for the constructor to be the one taking in the inputs.</p>
  
  <p>Thank you very much for the help Thrasher! if anyone has more input please let me know!</p>