开发者

Java class definition in runtime [duplicate]

This question already has answers here: Closed开发者_如何学C 11 years ago.

Possible Duplicate:

How do I programmatically compile and instantiate a Java class?

How to create a new java class at runtime?


Use Class<?> ClassLoader.defineClass(String name, byte[] b, int off, int len, ProtectionDomain protectionDomain)

The problem is that this method is protected. So, you should extend class loader with your own class and call this method from there.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜