Statements, Conditions, Loops and Scope - ISC Class 11 Computer Science Notes, Diagrams and Solved Questions
How Java chooses and repeats: if-else ladders, switch and fall-through, the ternary operator, for, while and do-while loops, break and continue, nested loops, and the block, method and class scope of variables.
In this chapter
How a condition is evaluated, and if, if-else and the if-else-if ladder
The dangling else and nested if statements
switch, case, default and fall-through (on purpose and by accident)
The ternary operator as a one-line if-else that gives a value
for, while and do-while: entry- and exit-controlled loops
break, continue and nested loops for patterns and number problems
Block, method and class scope, and the visibility rules for names that clash