Created
June 3, 2011 23:54
Java introspection for class name and function name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Print name of the current function. | |
new Throwable().fillInStackTrace().getStackTrace()[0].getMethodName(); | |
// Print simple class name. | |
getClass().getSimpleName(); | |
// Print full class name. | |
getClass().getName(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment