In this part of tutorial you will learn how to retrieve information of all methods of a class (that included in the program) by using the getMethods() method.
Getting Methods Information of a class
In this part of tutorial you
will learn how to retrieve information of all methods of a class (that included
in the program) by using the getMethods() method.
Here is an example that provides the usage of the getMethods() method in
more detail.
Create an object of class. Now retrieve all methods list in Method[]
array. Now we can get other information of that methods by using different
methods on that method object.
Here is the example code of MethodInfo.java
MethodInfo.java
import java.lang.reflect.*;
|
Output: