title: how to create a java abstract class list of subclass objects
body: <p>I have an abstract class, <code>carowners</code>. and two sub classes <code>person</code> and <code>company</code>.
  Abstract class <code>carowners</code> have fields:</p>
  
  <ul>
  <li>name</li>
  <li>address</li>
  <li>next(to reference next object(<code>person</code> or <code>company</code>)) .</li>
  </ul>
  
  <p>I need a list of <code>carowners</code> , where the objects in the list will either be a <code>Person</code> object or a <code>Company</code>- object (and indirect objects of type <code>CarOwner</code> ) .
  I know how to create a <code>Linkedlist</code> or <code>ArrayList</code> of type <code>CarOwners</code>, But its not my requirement. i need a abstractclassi.e carowners list that stores person and company objects, each objects refers to another using next in abstract class.</p>