i want to obtain a value and assign it to b in a while statement and i also want to test to see if B is null in the same statement, Please how do i do this
!= has precedence over =, so if you write it without parentheses the compiler will see this:
Now seeing as b is not a boolean, this will fail.
If you add parentheses as Jim has done, the compiler will have no problems anymore; it will first use the assignment to b, and only then compare the value of b to null.