This might seem quite straight forward to most of the programmers, but I was a little surprised to see the following code print true.
//The actual implementation has proper logic,
//just for simplicity I am using booleans in place of those logics
System.out.println(false && false || true && true || false && false);
Because my perception was that - if the 1st boolean value evaluates to false and the next operand is && then the jvm will not even try to evaluate the rest of the expression and just consider the whole as false
I was expecting code like below to work, but not the above one:
System.out.println((false && false) || (true && true) || (false && false));
Is it like the compiler by default groups the &&s between ||s