We can access the methods of a class Object
Method[] method = aClass.getMethods();
Methods are covered in more detail in the text on Methods.
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Date;
public class ReflectionExample {
public static void main(String[] args) {
Date date = new Date();
Class objCass = ArrayList.class;
Method[] methods = objCass.getMethods();
for (Method method : methods) {
System.out.println("************************");
System.out.println("Method Name : " + method.getName());
System.out.println("Method Parameters types : "
+ method.getParameterTypes());
System.out.println("Method return types : "
+ method.getReturnType());
}
}
}