Java tutorial
import java.lang.reflect.Method; import java.lang.reflect.Modifier; public class Main { public static void main(String[] args) { Method[] methods = java.lang.Integer.class.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { Method m = methods[i]; Class retType = m.getReturnType(); Class[] paramTypes = m.getParameterTypes(); String name = m.getName(); System.out.print(Modifier.toString(m.getModifiers())); System.out.print(" " + retType.getName() + " " + name + "("); for (int j = 0; j < paramTypes.length; j++) { if (j > 0) System.out.print(", "); System.out.print(paramTypes[j].getName()); } System.out.println(");"); } } }