Get all the methods of a class.
The getMethods method of Class class can be used for getting all the methods inside a class.
import java.lang.reflect.Method;
public class ClazzUtil {
public static void main(String[] args){
Method methods[] = Integer.class.getMethods();
for(int index=0; index < methods.length; index++){
System.out.println(methods[index].getName());
}
}
}
Tags: Class, Class examples, java.lang, java.lang.Class
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply