Java: Extending Class At Runtime

前端 未结 4 833
北恋
北恋 2020-12-29 10:55

I have the capability to extend a class at compile time, but I need to be able to create an instance of this subclass at runtime using an instance of the superclass that was

4条回答
  •  梦谈多话
    2020-12-29 11:27

    Have you looked at Java Proxies?

    Here is a snippet from Javadoc:

    "A dynamic proxy class (simply referred to as a proxy class below) is a class that implements a list of interfaces specified at runtime when the class is created"

提交回复
热议问题