title: java inheritance: distinguish between types of inherited classes
body: <p>I have an Abstract class, called <code>A</code>, and two inherited classes: <code>B</code> and <code>C</code>. I have a method with a parameter:</p>
  
  <pre><code>myMethod (final A a)
  </code></pre>
  
  <p>and I´d like to make different things in case of the type of the instanciated object. How can I do it?</p>
  
  <p>An good alternative is following another design pattern, but I am not allowed to change my code now.</p>
  
  <p>Thanks.</p>