Friday, March 16, 2012

Java get class name from static method

Okay, so it seems that Java is a really bad language. Apparently, you can't get the class name from a static method. Why? debugging, of course. You want to be able to have


stuff like this in any of your applications. Unfortunately, you can't do it from a static method (since there is no this object on which you can call .class.getSimpleName() ).

People tried to find alternatives -- see here: http://stackoverflow.com/questions/936684/getting-the-class-name-from-a-static-method-in-java and http://stackoverflow.com/questions/1075935/using-current-class-in-java-static-method-declaration

Still looking for my solution.

No comments:

Post a Comment