3: int temperature = 4;
4: long humidity = -temperature + temperature * 3;
5: if (temperature >= 4)
6: if (humidity < 6) System.out.println("Too Low");
7: else System.out.println("Just Right");
8: else System.out.println("Too High");
The above is a question from the Oracle Java OCP Study Guide chapter 4, question 2.
The answer says that this prints "Just Right".
The book tells us that control flow statements such as "if" require curly braces if there are multiple statements in that conditional branch.
Is the nested if-else statement considered a single statement or multiple statements?