If-else_MCQs_Practise
If-else_MCQs_Practise
6. What will happen if the break statement is not used in a switch case?
a) Only the matching case will execute
b) The program will terminate
c) All the cases below the matching case will also execute
d) An error will occur
Answer: c) All the cases below the matching case will also execute
2. Assertion (A): The switch statement can be used with int, char, String datatypes in
Java.
Reason (R): The switch statement only works with numeric data types.
a) Both A and R are true, and R explains A.
b) Both A and R are true, but R does not explain A.
c) A is true, but R is false.
d) A is false, but R is true.
Answer: c) A is true, but R is false.
GENERAL MCQS
1). Which of the following cannot be handled using a switch case?
a) char
b) int
c) boolean
d) String
Answer: c) boolean