title: Issue iterating through ArrayLists
body: <p>I have two questions. I have an object here that is of type <code>ArrayList</code>, and for this case let's call it <code>"Car"</code>.</p>
  
  <p>I have made 2 of them:</p>
  
  <pre><code>Car car1 = new Car();
  Car car2 = new Car();
  </code></pre>
  
  <p>I have a function to add items to those Car objects: </p>
  
  <pre><code>car1.addPart("Front Wheels");
  car1.addPart("Rear Wheels");
  car1.addPart("Rear View Mirror");
  
  car2.addPart("Rims");
  car2.addPart("Steering Wheel");
  car2.addPart("Bumper");
  </code></pre>
  
  <hr>
  
  <p>I need to have a function called <code>sameContents()</code> that I can call on <code>car1</code>: </p>
  
  <pre><code>car1.sameContents(car2);
  </code></pre>
  
  <p>which passes in an object of type <code>ArrayList</code> and checks it with <code>car1</code> to see if they have the same contents and in the same order.</p>
  
  <pre><code>public boolean sameContents(Car c) {
      ArrayList&lt;String&gt; other_car = c; // error: Type mismatch: 
                                      // cannot convert from Car to ArrayList&lt;String&gt;
  
      for (String c : this.parts) {
          System.out.println(c);
          for(String oc : other_car) { 
               // stuff
          }
      }
  }
  </code></pre>
  
  <p>I seem to be having all sorts of issues with this one. I can't get the <code>other_car</code> variable to be used in a foreach loop.</p>
  
  <hr>
  
  <p>The second one that needs to be done is <code>transferContents</code>. </p>
  
  <p>It's called like: </p>
  
  <pre><code>car1.transferContents(car2); 
  </code></pre>
  
  <p>which transfers the items in <code>car2</code> into <code>car1</code> and then leaves <code>car2</code> empty. I can't seem to get the <code>ArrayList</code> to work again in a foreach loop which is what I think I need.</p>
  
  <pre><code> public void transfer(Car c) {
       // code for transfer method.
       // this.parts is the arraylist of car parts
       for (Car c: c) {
      this.parts.add(c);
        }
      // not sure how to set car2 to empty...
   }
  </code></pre>