S
Suma Shanbhog
Hello,
In JAVA I had to implement something like conditional compiling.
I had earlier posted on this issue and got answers that it is not possible.
But now, a friend of mine suggested this:
class A{
public static final bool bDebug = true;
if(bDebug)
{
//do something
}
else
{
//do something else
}
}
But my argument was that the code in both if and else will be compiled.
But he says that as the bool variabel is "final"...., teh compiler know
whether it has to compile the if or the else.
So, does this serve the purpose of conditional compiling in the true sense?
Is that right?
Thanks in advance!
Suma
In JAVA I had to implement something like conditional compiling.
I had earlier posted on this issue and got answers that it is not possible.
But now, a friend of mine suggested this:
class A{
public static final bool bDebug = true;
if(bDebug)
{
//do something
}
else
{
//do something else
}
}
But my argument was that the code in both if and else will be compiled.
But he says that as the bool variabel is "final"...., teh compiler know
whether it has to compile the if or the else.
So, does this serve the purpose of conditional compiling in the true sense?
Is that right?
Thanks in advance!
Suma