title: When should I use generics to define relationships between types?
body: <p>Getting into a little bit of confusion here when to use generics.  I've looked at <a href="https://stackoverflow.com/questions/1301826/java-generics?rq=1">Java Generics?</a> but still have a few questions.</p>
  
  <p>Say I have:</p>
  
  <pre><code>public class Honda implements ICar(){
  }
  
  public class Opel implements ICar(){
  }
  </code></pre>
  
  <p>Should I use:</p>
  
  <pre><code>public class Person{
      ICar car;
      .
      .
      public Person (ICar c){
          car = c;
      }
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>public class Person&lt;T extends ICar&gt;{
      T car;
      .
      .
      public Person(T c){
          car = c;
      }
  }
  </code></pre>
  
  <p>or does it depend on the tasks performed?</p>
  
  <p>Are generics only for aggregation relationships (containers etc); that is, are they just used for collections?</p>