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

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
тесты по Scala
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты