What is the use of ‘yield’ keyword in Scala’s for-comprehension construct?
Answer Posted / Utkarsh Kumar Srivastava
'yield' keyword in Scala's for-comprehension construct is used to generate a sequence (such as List, Set, or Stream) by collecting the results of expressions executed during the iteration. It allows for easy creation and manipulation of sequences.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers