title: Cast from instance to interface is banned?
body: <p>Very simple code for test:</p>
  
  <pre><code>interface Base {
      void interfaceTest();
      static final String m = "1";
  }
  
  interface Child extends Base {
      void interfaceTestChild();
  }
  
  class BaseClass implements Base {
      @Override
      public void interfaceTest() {
          System.out.println("BaseClassInterfaceTest");
      }
  }
  
  class ChildClass implements Child {
  
      @Override
      public void interfaceTest() {
          System.out.println("ChildClassInterfaceTest");
      }
  
      @Override
      public void interfaceTestChild() {
          System.out.println("interfaceTestChild");
  
      }
  }
  
  public class Src {
      public Child testFunc() {
          Base x = new BaseClass();
          return (Child)x;      &lt;==Here got an "ClassCastException"
      }
  
      public static void main(String args[]) {
          Src testSrcInstance = new Src();
          testSrcInstance.testFunc().interfaceTest();
      }
  }
  </code></pre>
  
  <p>In the line <code>return (Child)x;</code> I got a "ClassCastException" and I feel very confused about it, for <code>Child</code> extends <code>Base</code>, so <code>x</code> should be converted to <code>Child</code> successfully. this kind of conversation is imitated by some android codes:</p>
  
  <p>the <code>getText()</code> method of <code>EditText</code> is:</p>
  
  <pre><code>public Editable getText() {
          return (Editable) super.getText();
      }
  </code></pre>
  
  <p>and the super class of <code>EditText</code> is <code>TextView</code>, of which the <code>getText()</code> method is:</p>
  
  <pre><code>public CharSequence getText() {
      return mText;
  }
  </code></pre>
  
  <p>mText is a <code>CharSequence</code>, and note that Editable extends CharSequence, so you can see, these android codes cast <code>CharSequence</code> to <code>Editable</code>, just as me, cast <code>Base</code> to <code>Child</code>, any difference?</p>