Originally posted by Francis Palattao:
I'm confused.
Should'nt we evaluate b and c first because of the precedance. Now since b && c already evaluates to true we wont evaluate a anymore.
XX.
Should'nt we evaluate b and c first because of the precedance. Now since b && c already evaluates to true we won't evaluate a anymore.
Mike Gershman
SCJP 1.4, SCWCD in process
SCJP 1.4<br />" Something is difficult doesn't mean you shouldn't try, it only means you should try harder "
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Originally posted by Kirti Singh:
Hi,
I've also read that "( )" have higher precednce over the operator " ||". Doesn't this mean that the statement
((b = true) && (c = true))
should be evaluted first ?
thanks
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
“Success is the ability to go from one failure to another with no loss of enthusiasm.” - Winston Churchill
if i use short ckt operator thjen why result is different?
boolean bool=(a = true) | (b = true) & (c = true)
then o/p is
a=true
b=true
c=true
Mike Gershman
SCJP 1.4, SCWCD in process