Bird
0
0

In Kotlin, what does the continue statement do inside a for loop?

easy📝 Conceptual Q2 of 15
Kotlin - Loops and Ranges
In Kotlin, what does the continue statement do inside a for loop?
AStops the entire loop immediately.
BRestarts the loop from the first iteration.
CSkips the rest of the current iteration and moves to the next iteration.
DExits the loop and returns a value.
Step-by-Step Solution
Solution:
  1. Step 1: Understand continue in loops

    The continue statement skips the remaining code in the current iteration.
  2. Step 2: Apply to a for loop

    When continue runs, the loop jumps to the next iteration immediately.
  3. Final Answer:

    Skips the rest of the current iteration and moves to the next iteration. -> Option C
  4. Quick Check:

    Continue behavior = skip iteration [OK]
Quick Trick: Continue skips current iteration, break stops loop [OK]
Common Mistakes:
MISTAKES
  • Thinking continue stops the loop
  • Confusing continue with break
  • Assuming continue restarts the loop

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes