Home > Java > javaTutorial > What is java reflection mechanism

What is java reflection mechanism

青灯夜游
Release: 2019-05-23 18:16:01
Original
2622 people have browsed it

What is java reflection mechanism

JAVA reflection mechanism is in the running state. For any entity class, all properties and methods of this class can be known; for any object, any method of it can be called. and attributes; this function of dynamically obtaining information and dynamically calling object methods is called the reflection mechanism of the Java language.

Java reflection mechanism is an important feature of the Java language, which is widely used in server programs and middleware programs. On the server side, it is often necessary to dynamically call a specific method of an object based on the client's request. In addition, in the implementation of ORM middleware, the Java reflection mechanism can be used to read all properties of any JavaBean or assign values ​​to these properties.

Function of JAVA reflection mechanism:

● The Java reflection mechanism mainly provides the following functions:

● Determine at runtime whether any object belongs to Class;

● Construct an object of any class at run time;

● Determine the member variables and methods of any class at run time;

● At run time When calling the method of any object;

● Generate a dynamic proxy.

Recommended related video tutorials: "JAVA Tutorial"

The above is the detailed content of What is java reflection mechanism. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template