Hello Wei -
Answer B is legal; but it's really two operations in one statement. The conditional (or ternary) operator is evaluated first, then the assignment. Therefore the result of the ternary operator is assigned to x.
------------------
Michael Ernest, co-author of:
The Complete Java 2 Certification Study Guide