Considering the following code, I don't understand why "System.out.println( c2 instanceof D);"
will result an "illegal compile time error" but not return "false"? Many thanks for your help!
interface I { }
class A { int x = 1;}
class B extends A implements I { int y = 2;}
class C extends B { }
class D extends B{ }
class E implements I { }
C c2 = new C();`
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…