Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Java introspection for class name and function name
// Print name of the current function.
new Throwable().fillInStackTrace().getStackTrace()[0].getMethodName();
// Print simple class name.
// Print full class name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment