I have been studying Reflection in Java for a few days now.
I have 2 classes, SimulatorInstance and SimulatorInstanceThread. I am trying to load an instance of SimulatorInstance using reflection and run that object as a new thread using Runnable interface from SimulatorInstanceThread.
I have tried to load the SimulatorInstance class using Classloader:
ClassLoader simInstance = SimulatorInstance.class.getClassLoader();
and tried running it as a new thread. But it doesn't work. I know this is probably very basic. But can someone point out what is the mistake here?
Aucun commentaire:
Enregistrer un commentaire