Problem during dynamic casting
Hi Guys,
Need you help
Situation is like this ?I have a function which accept the Sting parameter
Which is actually a full name of class ?using reflection I created the class and object
Now I want to cast this newly created object to their original class type
Code is somehow like this
Public void checkThis (String name) throws Exception{
Class c = Class.forName(name.trim());
Object o = c.newInstance();
System.out.println(" class name = " + c.getName());
throw ()o; //// here I want to cast this object to their orginal class type
/**
I tried throw (c.getName())o;
But it is not working
*/
}

