This week's book giveaway is in the Spring forum. We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line! See this thread for details.
The output will be "Mercury" and only the logic to the left of the || operator will ever be evaluated for the given boolean values.
You can read line 1 as:
if both b1 and b2 are true, execute the if-body immidiately. OTHERWISE if either b3 or b4 are true, or both are, execute the if-body. OTHERWISE execute the else body.
An equivalent if-else structure would be:
Remeber that in the abscence of parentheses the order of precendence for boolean operators is (highst priority first): 1. & 2. | 3. && 4. || [ March 22, 2008: Message edited by: Jelle Klap ]
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.