Which of the following is not true with regards to a switch statement?
Advertisements
प्रश्न
Which of the following is not true with regards to a switch statement?
पर्याय
Checks for an equality between the input and the case labels
Supports floating point constants
Break is used to exit from the switch block
Case labels are unique
MCQ
Advertisements
उत्तर
Supports floating point constants
Explanation:
- The switch statement in Java does not support floating point constants (float or double) as case labels.
- It only supports char, byte, short, int, their corresponding wrapper classes, and String and enum types.
shaalaa.com
Introduction of Conditional Statements in Java
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
