title: Java Copy Constructor ArrayLists
body: <p>I am trying to create a copy constructor considering the object is mutable. My copy constructor is wrong; I can't seem to figure out what I am doing wrong. </p>
  
  <p>Please do NOT tell me to use <code>clone()</code>. How would I complete the copy constructor in this situation? I am new to Java and would really appreciate any help.</p>
  
  <pre><code>public class MyList {
  
  
  public ArrayList&lt;Cool&gt; people;
  
  /**
   * "people" variable as a new (empty) ArrayList of Cool objects.
   */
  public MyPersonList()
  {
      people = new ArrayList&lt;Cool&gt;(0);    
  }
  
  
  /**
   * A copy constructor which makes the right kind of copy considering
   * a Cool is mutable.
   */
  public MyList(MyList other) 
  {
      people = new ArrayList&lt;Cool&gt;(); 
  
      for(Cool p:people)
      {   
          people.add(p);
      }
  
  }
  </code></pre>