Java – get the current class name? Try, This will work as long as you don’t use it in a static method.