public static boolean equalLists(int[] a, int[] b) {
if (a == b) return true;
return false;
}What is wrong?
- Acheck_circle
== compares references; the contents must be checked element by element
- B
Arrays cannot be compared at all
- C
Nothing is wrong
- D
The method should return false first
Explanation
For arrays, == returns true only if both references point to the same object, not when contents are equal. The method must compare lengths and each element.