First, what is reflection?
The concept of reflection was first proposed by Smith in 1982, and was primarily a capability for a program to access, detect, and modify its own state or behavior.
Second, the reflection in Java?
Reflection is one of the characteristics of the Java programming language, which allows the running Java program to check itself, or "self-audit", and to directly manipulate the internal properties and methods of the program.
Third, the class that the Java uses the reflection to use?
Each of them is:
1. Field: Provides information about the properties of a class or interface, and the dynamic access rights to it. The reflected field may be a class static property or instance property, and a simple understanding is that the class encapsulates the properties of the reflection class.
2. Constructor: Provides information about a single construction method of a reflection class and access rights to it.
3, Method: To provide information on the reflection class or an interface on one of the methods. The method that is reflected may be a static method or an instance method, including an abstract method.
4. Class: An instance of the class represents classes and interfaces in a running Java application. An enumeration is a class, and annotations are an interface. Each array belongs to a class that is mapped to a class object, and all arrays that have the same element type and number of dimensions share the class object.
A brief analysis of Java reflection mechanism