How to force Java to reload class upon instantiation?

后端 未结 6 1178
执念已碎
执念已碎 2020-12-04 22:52

Background:
I have a MainTest class that has many buttons, each of which instantiate a class that I am coding/testing. I want the code/test cycle for these classes to be

6条回答
  •  醉话见心
    2020-12-04 22:57

    Sounds a little scary, but this should help.

    http://download.oracle.com/javase/1.4.2/docs/api/java/lang/ClassLoader.html

    ClassLoader can dynamically load classes at runtime, I would read the api to determine if loading it again overrides the previous version.

提交回复
热议问题