If Wouter thinks this is beyond "beginning", then so do I. Moving thread.
Wouter Oet wrote: . . . If you're a java beginner I would advise you not to use this concept and focus on "normal" java.
K Abhijit wrote:(...)
I don't see much difference between this copy and earlier that i'd posted... let me know incase i am missing anything here...
Wouter Oet wrote:That's not really true because reflection can't modify the workings of functions. For that you need a java byte code manipulator like javassist. And your example doesn't compile and fails when you pass an object of a class with no default constructor.
Anand Hariharan wrote:Create a class C that has a constructor having one or more parameters (hence no default constructor) and use your WorkerClass.createObject to construct an instance of C.
Oet wrote:And your example doesn't compile and fails when you pass an object of a class with no default constructor.