0

I have this code:

case class BooleanArr( a1: Array[Boolean] )

val ba1 = BooleanArr(Array(true,false))
val ba2 = BooleanArr(Array(true,false))
println(ba1 == ba2)

This prints false, of course. How can I test equality so that it is true? I mean--I know that these are two different instances in memory so they're not "equal" (the same), but I want a way to see that they're "equal" (having same values). Is that possible without a field-by-field hand-coded check?

(Oddly... I learned this works as I'd wish if I use List instead of Arrays... but my use case requires Array, unfortunately.)

Greg
  • 10,696
  • 22
  • 68
  • 98

0 Answers0