This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
Is there a way to pass constructor parameters when dynamically loading a class ? ie Class.forName() The class I am trying to load is related to a database table. Does anyone know if using JDO is a better alternative to dynamically loading a class ? (.. or am I completely off the track here ?)
posted 14 years ago
Use the Class.getConstructor(Class parameterTypes) method and then get a new instance from that Constructor using Constructor.newInstance(Object initargs)