title: Which of the extension classes is this object?
body: <p>Assuming I have an array of <code>User</code> objects where each object is actually one of two classes that extends <code>User</code>. <code>ComputerUser</code> and <code>HumanUser</code> both extend <code>User</code>.</p>
  
  <p>Assume I'm iterating through the list and each object is named <code>o</code> when I am using it.</p>
  
  <p>Can I figure out if <code>o</code> is a <code>ComputerUser</code> or <code>HumanUser</code> simply by comparing like this:</p>
  
  <pre><code>if(o.getClass().equals(ComputerUser.class)) {}
  else if(o.getClass().equals(HumanUser.class)) {}
  </code></pre>