Method findRoom, revisited
// Return the room with id# targetId,
// or null if there is no such room.
public static Room findRoom(int targetId) {
while (r != null && r.id != targetId)
expression && expression is called a conjunction. It is true only when both operands are true. If the left operand is false, the right operand is not evaluated.
Note: The order of the conjunction is important! In particular, it would be wrong to use the conjunction
r.id != targetId && r != null