Get the Method Name
- From: "IveCal" <ive.cal@xxxxxxxxx>
- Date: 10 May 2006 23:41:45 -0700
Hello . . . Somebody help me . . . How will I get the name of the
present working method . . . A code snippet below is shown with the
part where I want to return the name of the method. please reply . . .
thanks a lot . . .
import java.lang.reflect.*;
public class This
{
public This(){}
public void thisMethod()
{
Class keyClass = this.getClass();
String keyName = keyClass.getName()
System.out.println("Class: "+keyName+", Method: "<<RETURN THE METHOD
NAME>>) );
}
public static void main(String[] args)
{
This t = new This();
t.thisMethod();
}
}
.
- Follow-Ups:
- Re: Get the Method Name
- From: dimitar
- Re: Get the Method Name
- From: oulan bator
- Re: Get the Method Name
- Prev by Date: two public class in a single file
- Next by Date: dump the program in exception
- Previous by thread: two public class in a single file
- Next by thread: Re: Get the Method Name
- Index(es):