LearnFrenzy
Sign in Take a free test

Control Flow Statements · Control Flow MCQ · Question 4

Which type cannot be switched on as a value? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 4 Back to Exercise

Which selector type is not allowed in a classic switch with constant case labels?

  • A String
  • B char
  • C long Correct
  • D an enum
Correct Answer: Option C

long, float, double and boolean are not allowed for value cases.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links