Created
June 17, 2011 03:26
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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