hi everyone. i am doing prepation for jcp a INTERFACE bINTERFACE | | CLASS B IMPLEMENTS A HERE NO RELATION BETWEEN A INTER AND B INTER IF IN A PROGRAM WE WRITE b obj1; B obj=(B)obj1; in this case there is no cmpile time error why
Hi, You get no compile error because you are using casting. When you perform casting you are telling the compiler that you know what you are doing and to stop checking if I am right! You will still get a run time error if the Object can't be cast to the interface! Regards, Manfred.