MCQs > IT & Programming > Scala > Choose output of the given code?

Scala MCQs

What is the output of the following code?

object MatchTest { def matchTest(x: Any): Any = x match { case 1 => "one" case "two" => 2 case y: Int => "scala.Int" } def main(args: Array[String]) { println(matchTest(2)) } }

Answer

Correct Answer: scala.Int

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