How to get string name of a method in java?

Posted by drozzy on Stack Overflow See other posts from Stack Overflow or by drozzy
Published on 2010-06-11T13:59:07Z Indexed on 2010/06/11 14:23 UTC
Read the original article Hit count: 158

Filed under:
|

How can I find out through reflection what is the string name of the method?

For example given:

class Car{
   public void getFoo(){
   }
}

I want to get the string "getFoo", something like the following:

 Car.getFoo.toString() == "getFoo" // TRUE

© Stack Overflow or respective owner

Related posts about java

Related posts about reflection