I am writing a desktop and j2me application. I have debug statements in program. Currently to avoid those getting compiled i use as following. We are doing this to reduce size of jar. (Specifically for mobile)
ConstantFile.java
Boolean ConstantFile.DebugEnabled = false;
if(ConstantFile.DebugEnabled) {
log.debug("msg");
}
But this is sort of hard coding. Is there an alternative like C where we have pre-compiled directives. Can Annotation help here ? Or something else i should look for ?