I'm just wondering if when you do this: int debug = 1; and then somewhere down in your program you do: if(debug == 1) System.out.println(mydebuginfo); if you happen to want to set debug to 0 as in int debug = 0; and you compile your program, are the if statements automatically ignored by the compiler, or is the program going to check every time to see if debug == 1 or not and slow my app down? P.S. Plz don't welcome me to the forums... i've been snooping around a while before registering, and i personally consider it lame. thanks for the consideration (and yes I know you weren't going to...)
Hi A., Welco... Uh, sorry. Don't want to be lame :roll: If a constant boolean condition can be evaluated at compile time, Java compilers are indeed allowed to optimized out a branch to a block of unreachable code. That said, I'm not sure they do enough induction to optimize out something based on integer comparison to a constant. Jikes and javac definitely will optimize out tests of boolean constants, so if you use the more idiomatic
Then the test will definitely be optimized away. You can answer this question for yourself, along with many related ones, using the "javap" tool that comes with the J2SDK. "javap -c MyClass" will disassemble MyClass to bytecode, and it's easy enough to check this kind of thing out.
Which part do you consider lame? The welcome part, or just our entire site?
the welcome part. what made you think i meant "our entire site?" since I was talking about being welcomed, the "it" refers back to the subject although my punctuation may have been the cause for your confusion. The previous post makes me think I hurt someone's feelings and I hope this clears up any misunderstandings. -> Sorry.