Hi, there is my code :
interface ssss {}
class c1 implements ssss {}
class c2 implements ssss {}
public class
Test {
public static void main (
String w[]){
c1 oc1= new c1();
c2 oc2= new c2();
ssss ioc1= oc1; //ok
ssss ioc2= oc2; //ok
System.out.println(ioc1.getClass() + " - " + ioc2.getClass());
ioc1=ioc2; //?
}
}
ioc1 is of type c1 while ioc2 is of type c2 , my question is why there is not error (invalid cast ..) at run time ?
Thanks Gabriele Rigamonti