LearnFrenzy
Sign in Take a free test

Control Flow Statements · Control Flow MCQ · Question 5

What does yield do? Answer, explanation & discussion

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

What is yield used for?

  • A To pause a thread
  • B To return a value from a block arm of a switch expression Correct
  • C To exit a loop
  • D To skip a case
Correct Answer: Option B

case X -> { …; yield value; }.

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