Link Details

Link 136088 thumbnail
User 313906 avatar

By pbielicki
via java2jee.blogspot.com
Published: Nov 24 2008 / 21:40

If you are a Java developer - have you ever wondered how to check in runtime where you are i.e. within what method you currently are in? Here is the two simple ways to achieve that.
  • 8
  • 2
  • 1454
  • 484

Comments

Add your comment
User 211643 avatar

zynasis replied ago:

0 votes Vote down Vote up Reply

haha fair enough...
when do you want to know where you are? for debugging? how about using an ide debugger?

User 219537 avatar

trevor replied ago:

0 votes Vote down Vote up Reply

I used it once to create a static method that returned Loggers initialized with the calling Class.

User 306626 avatar

yuku replied ago:

0 votes Vote down Vote up Reply

You can use jconsole (included in jdk), a GUI app for that purpose.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (8)



Voters Against This Link (2)