title: What is parametric polymorphism in Java (with example)?
body: <p>It is my understanding that parametric polymorphism is a technique which allows uniform actions over a variety of data(types). Is my knowledge correct?</p>
  
  <p>Is this example parametric polymorphism?
  I believe it is since Animal.talk allows talk to be called despite the specific animal type (Cat or Dog).</p>
  
  <pre><code>public interface Animal
  {
    public String talk();
  }
  
  public class Cat implements Animal
  {
    public String talk()
    {
      return "Cat says Meow!";
    }
  }
  
  public class Dog implements Animal
  {
    public String talk()
    {
      return "Dog says Woof! Woof!";
    }
  }
  
  import java.util.*;
  
  public class PolymorphismExample
  {
    public static void main(String[] args)
    {
      Collection&lt;Animal&gt; animals = new ArrayList&lt;Animal&gt;();
      animals.add(new Cat());
      animals.add(new Dog());
      for (Animal a : animals)
      {
        System.out.println(a.talk());
      }
    }
  }
  </code></pre>
  
  <p>Regards.</p>
  
  <p>edit: if my example is not specifically exhibiting parametric polymorphism please would you provide one? thank you.</p>