title: Clarification on the hierarchy of the command Interface
body: <p>In the following program in the class Parent the class Child implements MyInterface. Is that the reason why obj1 (Parent) instanceof MyInterface is false, while obj2 (Child) instanceof MyInterace is true?</p>
  
  <pre><code>    class InstanceofDemo {
      public static void main(String[] args) {
  
          Parent obj1 = new Parent();
          Parent obj2 = new Child();
  
          System.out.println("obj1 instanceof Parent: "
              + (obj1 instanceof Parent));
          System.out.println("obj1 instanceof Child: "
              + (obj1 instanceof Child));
          System.out.println("obj1 instanceof MyInterface: "
              + (obj1 instanceof MyInterface));
          System.out.println("obj2 instanceof Parent: "
              + (obj2 instanceof Parent));
          System.out.println("obj2 instanceof Child: "
              + (obj2 instanceof Child));
          System.out.println("obj2 instanceof MyInterface: "
              + (obj2 instanceof MyInterface));
      }
  
  
  }
  
  class Parent {}
  class Child extends Parent implements MyInterface {}
  interface MyInterface {}
  </code></pre>
  
  <p>Gives the following output:</p>
  
  <pre><code>obj1 instanceof Parent: true
  obj1 instanceof Child: false
  obj1 instanceof MyInterface: false
  obj2 instanceof Parent: true
  obj2 instanceof Child: true
  obj2 instanceof MyInterface: true
  </code></pre>