What will be the result of comparing collections?
mutable.Seq(1,2,3) == immutable.Seq(1,2,3)
Explanation
Within the same category, collections are equal if and only if they have the same elements (for sequences: the same elements in the same order). It does not matter for the equality check whether a collection is mutable or immutable. For a mutable collection one simply considers its current elements at the time the equality test is performed.
Read more: Collections equality in Scala

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Scala quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes