Say I have something like this in a C Code. I know you can use a #define
instead, to make the compiler not compile it, but just out of curiosity I'm asking if the compiler will also figure this thing out.
I think this is even more important for Java Compiler as it does not support #define
.
const int CONDITION = 0;
........
// Will the compiler compile this?
if ( CONDITION )
{
}
.......
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…