C
Crouchez
Class theClass = Class.forName("Object1");
Object1 o = theClass.newInstance();
((Object1)o).go();
I need to wrap the object as an Object1 to be able to call go(). If I am
reading the classes from disk and don't hardcode the classes into
Class.forName("????") how do I then wrap the resulting object?
Something like this:
Class theClass = Class.forName(file);
Object o = theClass.newInstance();
((obj.getClass().getName())o).go(); //can't do obj.getClass().getName()
Object1 o = theClass.newInstance();
((Object1)o).go();
I need to wrap the object as an Object1 to be able to call go(). If I am
reading the classes from disk and don't hardcode the classes into
Class.forName("????") how do I then wrap the resulting object?
Something like this:
Class theClass = Class.forName(file);
Object o = theClass.newInstance();
((obj.getClass().getName())o).go(); //can't do obj.getClass().getName()