Skip to content

Instantly share code, notes, and snippets.

@HotFusionMan
Created June 17, 2011 03:26
Show Gist options
  • Save HotFusionMan/1030812 to your computer and use it in GitHub Desktop.
Save HotFusionMan/1030812 to your computer and use it in GitHub Desktop.
Using Java reflection to print all the methods of a class, including their argument signatures.
import java.lang.reflect.Method ;
String className = "java.lang.Class" ; // or whatever class you're interested in
Class c = Class.forName( className ) ;
Method[] methods = c.getDeclaredMethods() ;
for ( Method m : methods )
{
System.out.println( m ) ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment