It is possible to load a class given a String and its name? ie "MyClass.class"
Further, is it possible to pass parameters to the开发者_高级运维 constructor using this method?
Have a look at Construct Object using class name.
Key methods being forName()
and newInstance()
.
Yes, look up the Reflection API.
精彩评论