Java Reflection mechanism: dynamic (runtime) Gets the information in the class is the Java reflection, can be understood as the anatomy of the class.
The reflection mechanism provides the main functions :
1) Determine the class to which any object belongs at run time
2) Constructs an object of any class at run time
3) Determine the member variables and methods that any one class has at run time
4) method of invoking any object at run time
The role of reflection technology: Improve the scalability of the program
Example : Tomcat uses the reflection mechanism to read all the methods in the Servlet class developed in the Web. XML configuration file, thus implementing a specific method of processing requests and corresponding (Response) (methods provided by the Web program developer, equivalent to extending the Tomcat program).
Java Reflection mechanism