val a: Array[Int] = Array(1,2,4,5) val b: Array[Int] = Array(1,2,4,5) a==b // false
Is there a pattern-matching way to see if two arrays (or sequen
For best performance you should use:
java.util.Arrays.equals(a, b)
This is very fast and does not require extra object allocation. Array[T] in scala is the same as Object[] in java. Same story for primitive values like Int which is java int.
Array[T]
Object[]
Int
int