title: Child objects and parent objects being passed into the same method
body: <p>I have a custom <code>QuadBatch</code> method, which as the name suggests, batches up quads to be drawn with one openGL call.</p>
  
  <p>I have 2 objects, which are created as follows:</p>
  
  <pre><code>QuadBatch sprite1 = new QuadBatch();
  
  NewSprite sprite2 = new NewSprite();
  </code></pre>
  
  <p>This is where <code>QuadBatch</code> is the parent class, and <code>NewSprite</code> is a subclass of it (ie, it extends <code>QuadBatch</code>).</p>
  
  <p>I did this because <code>NewSprite</code> required everything in the <code>QuadBatch</code> class, but also some extra stuff.</p>
  
  <p>If I have an animate method which takes a <code>NewSprite</code> object like so:</p>
  
  <pre><code>public void animate(NewSprite newSprite){
  
  //animation code here
  
  }
  </code></pre>
  
  <p>How can I use this same method but passing in a <code>QuadBatch</code> object?  I can't just pass in a <code>QuadBatch</code> object as the method expects a <code>NewSprite</code> object.</p>
  
  <p>The same question applies in reverse if the argument taken by the animate() method was a <code>QuadBatch</code> object.  How could I pass in a <code>NewSprite</code> object?</p>