Java reflection mechanism and method Invoke details
•
Java
Java reflection mechanism
Java reflection mechanism is to know all the properties and methods of any class in the running state; Any method of any object can be called; This kind of dynamically acquired information and the function of dynamically calling object methods are called the reflection mechanism of Java language.
Java reflection mechanism mainly provides the following functions: judge the class of any object at runtime; Construct the object of any class at runtime; Judge the member variables and methods of any class at run time; Call the method of any object at run time; Generate dynamic proxy.
1. Get the attribute of an object
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
二维码