What does an assignment expression evaluate to in Java?

The assignment operator in Java evaluates to the assigned value (like it does in, e.g., ). So here, readLine() will be executed, and its return value stored in line. That stored value is then checked against null, and if it’s null then the loop will terminate.

Leave a Comment