0

Possible Duplicate:
Can I get all methods of a class?

Is there a way to display all the availables methods of some class in java?

Community
  • 1
  • 1
yeah its me
  • 1,131
  • 4
  • 18
  • 27
  • 1
    Er... iterate over every single class and use reflection? It should be noted that "Java" is a language--it doesn't have methods. Classes have methods. Ah, you edited. Reflection is still the answer, though. – Dave Newton Apr 12 '12 at 15:54

2 Answers2

4

through reflection:

public static void main(String[] args){
    for (Method method : YourClass.class.getMethods()) {
        System.out.println(method.getName());
    }
}
John Ericksen
  • 10,995
  • 4
  • 45
  • 75
2

You can use Java reflection to get all information about a class.

talnicolas
  • 13,885
  • 7
  • 36
  • 56