MCQs > IT & Programming > Scala > For the type heirachy defined below, Choose the most correct statement below for the output?

Scala MCQs

For the type heirachy defined below, Choose the most correct statement below for the output?

trait A{ def a = 1 } trait X extends A{ override def a = { println("X") super.a } } trait Y extends A{ override def a = { println("Y") super.a } } For the expression val xy = new AnyRef with X with Y xy.a

Answer

Correct Answer: Prints Y then X

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