title: How does one use polymorphism instead of instanceof? (And why?)
body: <p>If we take the code below:</p>
  
  <pre><code>Shape p1 = new Square();
  Square c1;
  if(p1 instanceof Square) {
    c1 = (Square) p1;
  }
  </code></pre>
  
  <p><strong>What does it mean to prefer polymorphism to <code>instanceof</code>, and incidentally, why is it better?</strong></p>
  
  <p><strong>Edit:</strong>  I understand what polymorphism is; what I'm missing is how one would use it rather than <code>instanceof</code>.</p>