The problem is that my constructor needs the parameter "Board" which is the handle to the other class, but I cannot pass the parameter in claz.newInstance()
You see that I want to load classes dynamically where the class name is known at run time.
Any ideas what to do about this?
Joined: Jan 22, 2012
well, I figured out that I can use
Element elm = (Element) claz.getDeclaredConstructor(Board.class).newInstance(this);
Element elm = (Element) claz.newInstance();
which works fine, but still if anyone has a better proposal, please let share it. Thanks