Home | Gaming | Programming | Play Online | Contact | Keyword Query
Games++ Games & Game Programming

GAMES++
Games++ Home
Games++ Gaming
Games++ Programming
Beta Testing Games
Free Online Games
Hints & Cheats

BROWSER UTILITIES
E-mail This Page
Add to Favorites

SITE SEARCH

Web Games++

AFFILIATES
Cheat Codes
Trickster Wiki
Game Ratings
Gameboy Cheats
PlayStation Cheats
BlackBerry Games
Photoshop Tutorials
Illustrator Tutorials
ImageReady Tutorials

ADVERTISEMENT

ADVERTISEMENT

How To Get The Current Method Name

Java How To: Source Code

JDK 1.4

public class MyTest 
{
	public static void main(String args[]) 
	{
		new MyTest().doit();
	}

	public void doit() 
	{
		System.out.println(new Exception().getStackTrace()[0].getMethodName());
	}
}

The Output

doit
Copyright © 1998-2007, Games++ All rights reserved. | Privacy Policy