Yield in Scala is used to –

67. Yield in Scala is used to -

  1. Returns the resultant value of for loop
  2. Stores a variable at each for loop iteration
  3. Used with for loop
  4. 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.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.