Hi,
In
java always evaluation will be from left to right.
suppose take this expression
2 + 3 * 4 - 1 * 7
here you can think of the operands in expression will be grouped as follows
step 1: 2 + (3 * 4) - (1 * 7) according to precedence rules
step 2: ((2 + (3 * 4)) - (1 * 7)) accrding to associative rules
step 3: for any operator to be applied both operands must be first evaluated.
so as evaluation is from left to write first 2 + (3 * 4) needs to be evaluated.
2+(3*4)=> 2+12=14 then
14 - (1*7)=> 14 - 7 = 7
so final result is 7.
so in your code the grouping will be as follows
(a = true) || (b = true) && (c = true)
=> ((a=true) ||
( (b=true) && (c=true) ))
as evaluation will be from left to write
(a=true) is evaluated first which results in true and "a" is assigned value true .
as || is short hand operator if left operand is true, right operand is not evaluated.
so output will be true, false , false as default values for b and c are false.