I understand how to use Dynamic Proxies in Java but what I don’t understand is how the VM actually creates a dynamic proxy. Does it generate bytecode and load it? Or something else? Thanks.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
At least for Sun’s implementation, if you look at the source code of
java.lang.reflect.Proxyyou’ll see that yes, it generates the byte code on-the-fly (using the classsun.misc.ProxyGenerator).