title: Is there any runtime cost for Casting in Java?
body: <p>Would there be any performance differences between these two chunks?</p>
  
  <pre><code>public void doSomething(Supertype input)
  {
      Subtype foo = (Subtype)input;
      foo.methodA();
      foo.methodB();
  }
  </code></pre>
  
  <p>vs.</p>
  
  <pre><code>public void doSomething(Supertype input)
  {
      ((Subtype)input).methodA();
      ((Subtype)input).methodB();
  }
  </code></pre>
  
  <p>Any other considerations or recommendations between these two?</p>