How does Java’s dynamic proxy actually work?

I know how to use dynamic proxies in Java, but what I don't understand is how VM actually creates dynamic proxies Does it generate bytecode and load it? Or something else? thank you.

Solution

At least for sun's implementation, if you look at Java lang.reflect. Proxy source code, you will see that yes, it will generate byte code (using the class sun. Misc. Proxygenerator)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>