title: Java instanceof implements/extends
body: <p>How does instanceof work exactly? When I have a hierarchy of objects that extend and implement eachother, does being instance of something work through these both lines?</p>
  
  <p>For example I want to know if my object is instance of <code>List</code>or <code>ArrayList</code> or <code>Collection</code>?</p>
  
  <p>I examined this tree, <a href="http://docs.oracle.com/javase/6/docs/api/java/util/package-tree.html" rel="noreferrer">http://docs.oracle.com/javase/6/docs/api/java/util/package-tree.html</a></p>
  
  <p>And they seem to fall all under <code>Object</code> ofcourse, but what I need, I think is <code>AbstractCollection</code> or even normal <code>Collection</code> , because that seems to be the highest in hierarchy.</p>
  
  <p>Will I be fine, when I check an object against only <code>Collection</code> to cover all those 3 classes?</p>