Extending or adding new classes at runtime in Java

前端 未结 3 1191
情书的邮戳
情书的邮戳 2020-12-11 06:36

Is there a way to add (or extend existing) classes at runtime in java. I\'m stuck on a problem, in which I have to extend an existing class at runtime and add this to the cl

3条回答
  •  余生分开走
    2020-12-11 07:26

    You should definitely write why you need this feature. If you attempt to add or replace logic at runtime you might want to have a look at the scripting API and some actual implementations.

提交回复
热议问题