Oracle
1Z0-803 · Question #56
1Z0-803 Question #56: Real Exam Question with Answer & Explanation
The correct answer is A: int. A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types the String class, and a few special classes that wrap certain primitive types: Character, Byte, Short, and Integer.
Question
Which three are valid types for switch?
Options
- Aint
- Bfloat
- Cdouble
- Dinteger
- EString
- FFloat
Explanation
A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types the String class, and a few special classes that wrap certain primitive types: Character, Byte, Short, and Integer.
Community Discussion
No community discussion yet for this question.