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