Home arrow static arrow Java Programming [Archive] - get Method Name
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - get Method Name
This topic has 2 replies on 1 page.

Posts:290
Registered: 4/19/01
get Method Name  
Jul 25, 2001 10:59 PM



 
Hello group ,
By doing this
this.getclass().getName();
we get the name of the class we are in . Is there any way to get the name of the method we are in ?

 

Posts:11,200
Registered: 7/22/99
Re: get Method Name  
Jul 25, 2001 11:19 PM (reply 1 of 2)



 
In jdk1.4 only: throw and catch an exception. You can find the method name form the stacktrace: http://java.sun.com/j2se/1.4/docs/api/java/lang/Throwable.html#getStackTrace()
 

Posts:2
Registered: 11/5/00
Re: get Method Name  
Jul 22, 2004 12:05 AM (reply 2 of 2)



 
you may refer here http://www.rgagnon.com/javadetails/java-0420.html
 
This topic has 2 replies on 1 page.