Home
MCQs
Java MCQs
Control Statements
Java MCQs

Java MCQs - Control Statements

Control statements are the set of statements which can be controlled of execution flow on the behalf of conditions. Conditions like IF Condition, IF ELSE Condition, SWITCH Condition. One can run the set of statement or skip the set of statements where conditions are met. In this list of MCQs you will cover all possible mcqs for Control Statements.

1. An statement that checks the equality only ?

A. If

B. Switch

C. If and Switch

Answer: B

2. "If statement" is used to test the condition.

A. true

B. false

Answer: A

3. If condition is false then ?

A. Block of If condition will be executed

B. Block of If condition will not be executed

C. Block of Else will be executed (If exists)

D. Both B & A

Answer: D

4. What is the correct output of this program ?

A. Compile time Error

B. Run time Error

C. If condition true

Answer: C

5. What is the correct output of this program ?

A. If condition true

B. Else true

C. Both of above

Answer: A

6. What is the correct output of this program ?

A. A greater than B

B. A less than B

C. Both of above

Answer: B

7. What is the correct output of this program ?

A. A greater than B

B. A less than B

C. A greater than B OR A less than B

D. Invalid Condition

Answer: C

8. What is the correct output of this program ?

A. A greater than B

B. A less than B

C. A greater than B OR A less than B

D. Valid Condition

Answer: D

9. What is the correct output of this program ?

A. Compile time Error

B. A equals to B

C. A is not equals to B

Answer: B

10. What is the correct output of this program ?

A. A less than B

B. A greater than B

C. Compile time error

Answer: A