get runtime class and cast object to it?
Hi,
publicinterface Msg
{
...
}
...
Msg msg=msgLib.get(msgType);
Msg msg2=msg.clone();//problem! cannot find clone in x.y.Msg!
...
Shouldn't msg be resolved to the implementing class (MsgReply for example) and use the "clone()" method, that i have declared in that class -which overrides the one of Object class?
If no, is there a way to find the runtime class -probably use "getClass"- and cast to it? How?
Thanks

