Home »
MCQs »
Scala MCQs
Yield in Scala is used to –
67. Yield in Scala is used to -
- Returns the resultant value of for loop
- Stores a variable at each for loop iteration
- Used with for loop
- All of these
Answer: D) All of these
Explanation:
For each iteration of your for loop, yield generates a value which is remembered by the for loop.