Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 2
    Why didn't reflection work? Commented Jan 20, 2013 at 20:47
  • What did you try with reflection? It would be helpful to actually tell us what you tired rather than just stating it doesn't work when clearly reflection would work. Commented Jan 20, 2013 at 20:48
  • If you're calling the method identified by et, why bother looking it up in the array? Commented Jan 20, 2013 at 20:49
  • The accepted answer in the first comment would work. In your case, you can change where they use "obj" to "this" since your methods are in the current class. Commented Jan 20, 2013 at 20:50
  • 1
    you can not call the method-object if it is null. it does not return any value, so do not cast and return the result. put your getMethod and the invoke in one try block instead... Commented Jan 20, 2013 at 21:01