| Author |
Short-Circuit Problem
|
Micheal John
Ranch Hand
Joined: Nov 01, 2006
Posts: 344
|
|
|
Micheal John
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
|
 |
Sanjeev Singh
Ranch Hand
Joined: Nov 01, 2006
Posts: 381
|
|
|
||(short circuit OR) don't bother to check the second OR if the first one is true while (|) bitwize OR does.
|
~Sanjeev Singh<br />SCJP 1.5
|
 |
annapurna madala
Greenhorn
Joined: Oct 30, 2006
Posts: 6
|
|
As you said thats the short-circuit problem In the first case, ++z>5 evaluates to true, so the ++z>6 will not be evaluated(because '||' is a short-circuit operator) where as in the second case, even when the first operand evaluates to true ++z>6 will be executed giving the output as 8
|
 |
 |
|
|
subject: Short-Circuit Problem
|
|
|