0

Some one can explain to how it's works and why?

val xs1 = Set(3, 2, 1, 4, 5, 6, 7)
val ys1 = Set(7, 2, 1, 4, 5, 6, 3)
xs1 sameElements ys1 // true

val xt1 = Set(1, 2, 3)
val yt1 = Set(3, 2, 1)
xt1 sameElements yt1 // false

Other question, if this behavior violates the api contract of Set?

mkUltra
  • 2,828
  • 1
  • 22
  • 47

0 Answers0