Multiple choice technology programming languages

The expression to the switch must be of a type

  1. byte/int,

  2. short,

  3. char,

  4. float

Reveal answer Fill a bubble to check yourself
A,B,C Correct answer
Explanation

Java switch expressions can only be of types byte, short, char, int, and their wrapper classes, plus enums and Strings (Java 7+). Float and double are not allowed because they require comparison with == which is unreliable for floating-point. Options A, B, C list valid integral types. Option D (float) is invalid.