I am trying to read a file and create a new instance of the classes whenever it finds the class name from this file and would like to know how to get the Constructor. My code works fine, but when it reaches the Constructor line, it throws ClassNotFoundException. I have all of the required classes compiled in the same folder. Looks like, I am doing something silly here. Can someone point me in the right direction? I am new to this Reflection stuffs.
It will be easy if you give code for class which String "type" is stored
Life is easy because we write the source code.....
Joined: Mar 30, 2010
Thank you for your quick reply. The file that is loading is as follows.
TestClassA : 0
TestClassB : 1
You can create a simple TestClassA and TestClassB and compile them under the test folder. The whole program is really big and for demo, I have only listed partial code here. This code compiles without any issues except this is not getting the Constructor.