KnowledgeBoat Logo

Computer Applications

Which of the following is not true with regards to a switch statement?

  1. checks for an equality between the input and the case labels
  2. supports floating point constants
  3. break is used to exit from the switch block
  4. case labels are unique

Java Conditional Stmts

ICSE Sp 2025

6 Likes

Answer

supports floating point constants

Reason — The switch statement does not support float or double constants as case labels. It supports byte, short, int, char, String and enum.

Answered By

2 Likes


Related Questions