title: ArrayList ClassCastException with extended object
body: <p>I don't know exactly how to word this title, but here is the problem</p>
  
  <p>I have an <code>ArrayList</code> of Object B</p>
  
  <p>Object B extends Object A</p>
  
  <p>I want to add an element of Object A to the <code>ArrayList</code>.  I feel like I should be able to do this because Object A is a simpler version of Object B  (or should I say, Object B is a subset of Object A)</p>
  
  <p>But I get <code>ClassCastException</code>, what is the solution for this while keeping the extended objects as separate objects.</p>