title: Why does it compile when casting to an unrelated interface?
body: <pre><code>interface Printable {}
  class BlackInk {}
  
  public class Main {
      public static void main(String args[]) {
          Printable printable = null;
          BlackInk blackInk = new BlackInk();
          printable = (Printable)blackInk;
      }
  }
  </code></pre>
  
  <p>If the preceding code is compiled and run, the result is a ClassCastException at <code>printable = (Printable)blackInk;</code>. But, if Printable is changed to a class, it doesn't compile because blackInk can't be cast to Printable. Why does it compile when Printable is an interface?</p>