title: Multiple interface: instanceof cannot differentiate different interfaces
body: <p>If I have the following:</p>
  
  <pre><code>interface a {
      void a_m();
  }
  
  interface b {
      void b_m();
  }
  
  class x implements a, b {
  
      public static void main(String [] args) {
           x cx = new x();
           System.out.println(cx instanceof a); &lt;-- true
           System.out.println(cx instanceof b); &lt;-- true
      }
  
      void a_m() {}
      void b_m() {}
  
  }
  </code></pre>
  
  <p>The <code>instanceof</code> operator will return true for both.  </p>
  
  <p>Of course I know that <code>getClass()</code> will do the trick but I'm just puzzled of the usage of <code>instanceof</code> here.</p>
  
  <p>In the above case, interfaces a and b are different and there must be a way which tells them apart (as far as class x is concerned).</p>
  
  <p>Any advice would be great</p>