Computer Applications
Which of the following data type cannot be used with switch case construct?
- int
- char
- String
- double
Java Conditional Stmts
ICSE 2024
7 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:
int
char
String
Answered By
4 Likes
Related Questions
The extension of a Java source code file is:
- exe
- obj
- jvm
- java
The number of bytes occupied by a character array of four rows and three columns are:
- 12
- 24
- 96
- 48
Which of the following are entry controlled loops?
(a) for
(b) while
(c) do..while
(d) switch
- only a
- a and b
- a and c
- c and d
Method which reverses a given number is:
- Impure method
- Pure method
- Constructor
- Destructor