Adolfo Eloy wrote:
In this case, the compiler can't tell if the C instance, is just a C instance, or some subclass of C (which IS-A C) that also happens to implement the Runnable interface.
Adolfo Eloy wrote:
In this case, the compiler can tell. Since the D class is final, the D instance is just a D instance. And since the D class doesn't implement Runnable, the cast is not allowed.
Henry