KnowledgeBoat Logo

Computer Applications

Which of the following data type cannot be used with switch case construct?

  1. int
  2. char
  3. String
  4. double

Java Conditional Stmts

ICSE 2024

10 Likes

Answer

double

Reason — The switch statement in Java supports specific data types for the case labels. However, double and float data types cannot be used.

Data Types supported in switch statement are:

  1. int
  2. char
  3. String

Answered By

5 Likes


Related Questions