I want to discover at run-time ONLY the static Methods of a class, how can I do this? Or, how to differentiate between static and non-static methods.
To flesh out the previous (correct) answer, here is a full code snippet which does what you want (exceptions ignored):
public Method[] getStatics(Class> c) {
Method[] all = c.getDeclaredMethods()
List back = new ArrayList();
for (Method m : all) {
if (Modifier.isStatic(m.getModifiers())) {
back.add(m);
}
}
return back.toArray(new Method[back.size()]);
}