MCQs > IT & Programming > Scala > Which one is equivalent to the code below?

Scala MCQs

Which one of the following options is equivalent to the code below? for { x <- 1 to 10 y <- 1 to 10 } yield (x,y)

Answer

Correct Answer: (1 to 10).flatMap( x => (1 to 10).map(y => (x,y)))

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Scala Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Scala Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it