What is Reflection and How it Works in Java
“Reflection is the process of obtaining runtime information about the class or interface.”
Runtime information is nothing but deal with the following:
- Finding the name of the class or interface.
- Finding the data members of the class or interface.
- Finding number of constructors (default constructor and number of parameterized constructors).
- Number of instance methods.
- Number of static methods.
- Determining modifiers of the class (modifiers of the class can be public, final, public + final,abstract and public + abstract).
- Obtaining super class of a derived class.
- Obtaining the interfaces which are implemented by various classes.