Because in this case i am getting a class cast exception for class p.c on launching the application with this structure.
I don't think there is any way to avoid a class cast exception if you try to assign to a reference in a class created by the parent class loader. I suspect you will have to use
Java's reflection capabilities.
Maybe java.lang.reflect.Proxy will help.
Bill