title: foreach not applicable to type
body: <p>I am trying to store the dog and fish object into the LinkedList, why is my enhanced for loop not working?</p>
  
  <pre><code>public class Main {
  
      public static void main(String[] args) {
          AnimalList animal = new AnimalList();
          Animal dog = new Dog();
          Animal fish = new Fish();
  
          animal.add(dog);
          animal.add(fish);
      }
  }
  
  import java.util.LinkedList;
  import java.util.List;
  
  public class AnimalList {
      private List&lt;Animal&gt; theList = new LinkedList&lt;&gt;();
  
      public void add(Animal animal) {
          for (Animal x: animal) {  &lt;--------- foreach not applicable to type.
              theList.add(x);
              System.out.println(x);
          }
      }
  }
  
  public class Animal {
  }
  
  public class Dog extends Animal {
  }
  
  public class Fish extends Animal {
  }
  </code></pre>