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 \
Thats because compiler can check at compile time that such instanceof would always return false, you can read on it in JLS:
http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.20.2
If a cast of the RelationalExpression to the ReferenceType would be rejected as a compile-time error, then the instanceof relational expression likewise produces a compile-time error. In such a situation, the result of the instanceof expression could never be true.
RelationalExpression is first operand, and ReferenceType is second: RelationalExpression instanceof ReferenceType