A book I'm working from states :
The short-circuit operators are nearly identical to the logical operators,
&
and|
, respectively, except that the right-hand side of the expression may never be evaluated if the final result can be determined by the left-hand side of the expression
To test this out I tried
int y = 1;
boolean x = false | (y < 4);
System.out.print(x); //true
Which printed out true as expected.
however
int y = 1;
boolean x = false || (y < 4);
System.out.print(x); //true
also prints out true which seems to contradict the book "the right-hand side of the expression may never be evaluated if the final result can be determined by the left-hand side of the expression".
I was assuming x would take the value of false as the final result can be determined from the left hand side alone