MCQs > IT & Programming > Scala > What will the following function return: def foo(o:Any) = { o match { case Option(x) => "hi!" case anything => anything } } When passed a 'None' object?

Scala MCQs

What will the following function return: def foo(o:Any) = { o match { case Option(x) => "hi!" case anything => anything } } When passed a 'None' object?

Answer

Correct Answer: It won't compile

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