I am preparing for JCP 1.4 and I saw a question in Boone's mock exam, the code of which is as follows:
class A{}
class B extends A{}
class c extends B{}
A a = new A();
B b = new B();
C c = new C();
Now it says that this statement is illegal.
b=(B)c;
Can anyone tell me why it is illegal to cast an object reference and assign it.
Thnaks a lot
Latha