I am using the getMethod(String name) function to load a method but it always throws MethodNotFoundException. If I run class.getMethods() the method I am looking for is in that result with the exact name I am using to pass to getMethod(). The method I am trying to load is a static method so I don’t know if getMethod() will not work for static methods. Any help?
I am using the getMethod(String name) function to load a method but it always
Share
If the method you’re looking for takes any arguments, you need to pass their types to
getMethod()as well. A Java method’s signature (the thing that uniquely defines and identifies a method) is comprised of the method name and its parameter types.http://download.oracle.com/javase/tutorial/java/javaOO/methods.html