1. . …………………….. statement provides an easy way to dispatch execution to different parts of your code based on the value of an expression.
(A) if-else
(B) switch
(C) if
(D) while
2. . In the while and do-while loops, a ………………… statement causes control to be transferred directly to the conditional expression that controls the loop.
(A) break
(B) pause
(C) start
(D) continue
3. . Which of the following control expressions are valid for an if statement?
(A) an integer expression
(B) either A or B
(C) a Boolean expression
(D) Neither A or B
4. . By using …………………….., you can force immediate termination of the loop, bypassing the conditional expression and any remaining code in the body of the loop.
(A) switch
(B) default
(C) continue
(D) break
5. . The ………………………. loop is especially useful when you process a menu selection.
(A) while
(B) switch
(C) for
(D) do-while
6. . If you need to select among a large group of values, a switch statement will run much faster than the equivalent logic coded using ……………….. statement.
(A) if
(B) while
(C) do-while
(D) if-else
7. . The ………………. is an optional case when it will be executed if the value of the expression does not match with any of the case values.
(A) default
(B) break
(C) continue
(D) switch
8. . The ……………………… statement at the end of each block signals the end of a particular case and causes an exit from the switch statement, transferring the control to the statement following the switch.
(A) break
(B) switch
(C) continue
(D) default
9. . The ………………… statement tests the value of a given variable against a list of case values and when a match is found, a block of statements associated with that case is executed.
(A) switch
(B) break
(C) continue
(D) default
10. . An IF-ELSE statement is also called ________________.
(A) All
(B) Control statement
(C) Block statements
(D) Branching statement
11. . An IF statement in Java is also a ________________statement.
(A) Boolean
(B) iterative
(C) conditional
(D) optional
12. . An ELSE statement must be preceded by ________statement in Java.
(A) IF or ELSE IF
(B) ELSE IF
(C) IF
(D) None
13. . The condition of an IF statement evaluates to boolean only if the expression contains?
(A) Logical operators
(B) All
(C) Boolean operands
(D) Relational operators
14. . Which of the following is not a decision making statement?
(A) if
(B) if-else
(C) do-while
(D) switch
15. . Which of these are selection statements in Java?
(A) for()
(B) if()
(C) continue
(D) break
16. . Which of the following for loop declaration is not valid?
= 0; i / 9 )')"> (A) for ( int i = 2; i <= 20; i = 2* i )
= 0; i / 9 )')"> (B) for ( int i = 7; i <= 77; i += 7 )
= 0; i / 9 )')"> (C) for ( int i = 20; i >= 2; - -i )
= 0; i / 9 )')"> (D) for ( int i = 99; i >= 0; i / 9 )
17. . ______________ is not a flow control statement in Java.
(A) break
(B) continue
(C) exit()
(D) return