In evaluating the expression (x==y && a<b)
the boolean expression x==y
is evaluated first and then a<b
is evaluated in Java ? (True or False):
I find False as the answer but I can't reason it. Moreover, according to my C/C++ knowledge, if x==y
evaluated to false, the whole expression (x==y && a<b)
evaluates to false without even moving on to evaluate a<b
.
If this was similar for Java
, the answer to the statement must have been True.
I couldn't find any suitable explanation for the statement to be False, so please help me out.