开发者

Loading a class by its name MyClass.class - is this possible?

开发者 https://www.devze.com 2022-12-30 05:07 出处:网络
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 Construc

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消