ClassCast Exception
I have two Jar files: J1 and J2. J1 contain class C1. J2 contain class C2 and class C3.
public class C1{}
public class C2 extends C1{}
public class C3
{
public C1 get_class()
{
return new C2();
}
}
I put J1 on client side and J2 on server side. Then I try to load C3 from J2 dynamically on client side. I create instance of C3 and invoke method get_class(). On output on client side I have Object obj than has class name C2. but I can not cast it to C1. If I call: C1 c = (C1)obj; I have got ClassCast Exception. How to fix this code?

