In C/C++, I can use as follows
int main()
{
#if defined(DEBUG_MODE)
// The following code may contain sensitive messages.
// But these sensitive messages won't be compiled into the release binary.
A lot of debugging mode code here, which will bloat the final executable.
......
#endif
}
How to do the same thing in Java?
What I want is to reduce the final size of classes and to remove all sensitive debugging messages.
That is, the following Java code is not what I want.
class A
{
public void f()
{
if (DEBUG_MODE)
{ // The following code may contain sensitive messages.
// So I want to remove them before release.
A lot of debugging mode code here, which will bloat the final executable.
......
}
}
}