Rob Prime wrote:Not newInstance, but using reflection you could do this:
- use Class.forName to get the Class instance
- get the right Constructor
- create an instance using that Constructor
Steve Luke wrote:Look at the API for Class. It has methods for getting a particular Constructor, if you know its parameter types, and a method for getting an array of constructors which you can search through to find the best CTor for your task.
Once you have the correct Constructor, you can use one of its methods to create a new instance using the Constructor.
See if you can find the correct methods in the API, and let us know if you run into trouble.