int C=0;
boolean A=C==1;
The compiler first gives C zero.
Variable : C
Value : 0
Now the assignment operator
We know that the assignment operator first evaluates the right side and gives it to the left.
Right part ==> C == 1
Here is an expression that evaluates to trueor false. In this case, this is not true asc is 0.
Therefore, RHS is false.
Now it is assigned to LHS, which is A.
A = ( C == 1 ) ==> A = false
Since it Ais logical, this is a valid statement.