Abhi, when you create the anonymous class instance it can only pass the Is-A
test for Serializable, so the compiler will catch that it can never be cast to C. You could do it the other way around though (I think, you can try this and see if it works)
Serializable s = (Serializable) new C(){};
In this case, the instance of the anonymous class would pass the Is-A test for C, which itself passes the Is-A test for Serializable, so the cast would both compile and run.
[ December 28, 2008: Message edited by: Ruben Soto ]