My Java is rusty so please bear with me. In C I can do:
int someFunc(void)
{
printf("I'm in %s\n", __func__);
}
In Java, can I lexically get to the name or class of the type currently being defined. For example, if I have:
import org.apache.log4j.Logger;
class myClass {
private static final Logger logger = Logger.getLogger(myClass.class);
...
}
It seems wrong to repeat "myClass" in the getLogger() argument. I want "getLogger(__CLASS__)" or "getLogger(this.class)" or something. (I know both of those are silly but they should point to what I'm looking for.) Does the Java compiler really not know what class it's in the middle of as it processes source?