How to Create a class dynamically with its variables and methods in Java?

前端 未结 1 1563
执笔经年
执笔经年 2021-01-15 13:06

How to Create a class dynamically with its variables and methods in Java without using Reflections.

I want that the class should be created at runtime with variables

相关标签:
1条回答
  • 2021-01-15 13:30

    You can use janino, which compiles a String of java code into a class. I have used it to great effect.

    Also popular is Javassist.

    0 讨论(0)
提交回复
热议问题