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

ICSE Class 10 Computer Applications PYQ · 2024 Paper · Section A

1(xii)1 Mark · 2024 · Section A · 2024 Paper

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

Show SolutionHide Solution↓

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
← Previous questionNext question →

Browse the free Computer Applications sample bank