The basic concept of reflection in java

*, Basic information: What is reflection?

Reflection is that in the running state, for any class, you can know all the properties and methods of this class; for any object, you can call any of its methods and properties; this kind of dynamically obtained information and dynamic call object's The function of the method is called the reflection mechanism of the java language

 

*, Basic information: What is a class loader?

The class loader loads the .class file of the class from the hard disk into the Java virtual machine through the .classLoader() method of a certain class to form a bytecode file;

 

*, Basic information: What is a dynamic proxy?

Dynamic proxy is to realize the function of the target class and add unique system functions, pass in the class loader, the interface of the target class, and the implementation subclass of the InvocationHandler interface, in other words, use the reflection mechanism to create a proxy object (invoke of the InvocationHandler interface () method, to pass in the proxy object, method name, method parameters, in the invoke method, you can add unique system functions)

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326525802&siteId=291194637