title: ArrayList as a paramater in constructor
body: <p>I am struggling to comprehend the ArrayList when used in a constructor.</p>
  <p>Let's say I have the following code:</p>
  <pre><code>public class Names {
      ArrayList&lt;String&gt; names;
      private int number;
      
      public Names(int numberIn, ArrayList&lt;String&gt; namesIn) {
          number = numberIn;
          names = namesIn;
      }
  }
  </code></pre>
  <p>If I created another class to test the names class like so:</p>
  <pre><code>public class NamesTester {
  
      public static void main(String[] args) {
          Names n = new Names(10, ??? );
      }
  }
  </code></pre>
  <p>How can I add to the array using the constructor's parameter? Do I list the names somehow where the question marks are?</p>
  <p>I can't figure this out so any help would be much appreciated.
  Just to clarify, when creating a new object 'n' in the NamesTester class, I would like to call the constructor so that the number of students (10) and their names (&quot;Jack&quot;, &quot;John&quot;, etc.) are held in the 'names' and 'number' attributes so that when I add the setters for both, I can print them.</p>