MCQ Single Best Answer Easy

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

ID: #24261 ICSE Computer Application - Class X - 2025 SPECIMEN QUESTION PAPER 52 views
Question Info
#24261Q ID
EasyDifficulty
ICSE Computer Application - Class X - 2025 SPECIMEN QUESTION PAPERTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A checks for an equality between the input and the case labels
  • B supports floating point constants
  • C break is used to exit from the switch block
  • D case labels are unique
Correct Answer: Option B

Explanation

Switch statement rules in Java

  1. Checks for equality between the input expression and case labels → ✅ True

  2. Supports floating point constants → ❌ Not allowed

    • In Java, switch can only work with:

      • byte, short, char, int

      • Their wrapper classes (Byte, Short, Character, Integer)

      • String

      • enum types

    • float and double are not allowed.

  3. break is used to exit the switch block → ✅ True

  4. Case labels are unique → ✅ True


Answer: (b) supports floating point constants

Share This Question

Challenge a friend or share with your study group.