Which of the following variable types is not permitted in a switch statement?



Which of the following variable types is not permitted in a switch statement?

A. String

B. double

C. int

D. char

Answer:

B. double

Explanation:

A switch statement supports the primitive types byte, short, char, and int and the classes String, Character, Byte, Short, and Integer. It also supports enumerated types.

Floating-point types like float and double are not supported, therefore Option B is the correct answer.

Free Spring Boot Tutorial - 5 Hours Full Course


Watch this course on YouTube at Spring Boot Tutorial | Fee 5 Hours Full Course

Comments