LearnFrenzy
Sign in Take a free test

Control Flow Statements · Control Flow MCQ · Question 8

What does when do in a switch case? Answer, explanation & discussion

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

In Java 21, what does case Integer i when i > 100 -> mean?

  • A It casts every value to Integer
  • B It matches only Integers greater than 100, binding the value to i Correct
  • C when is a loop
  • D It is invalid syntax
Correct Answer: Option B

A guard adds a boolean condition to a pattern.

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