...
This compliant solution compares the content of two arrays using the two-argument Arrays.equals()
method.:
Code Block | ||
---|---|---|
| ||
int[] arr1 = new int[20]; // initializedInitialized to 0 int[] arr2 = new int[20]; // initializedInitialized to 0 System.out.println(Arrays.equals(arr1, arr2)); // printsPrints true |
Compliant Solution
This compliant solution compares the array references using the reference equality operators ==
:
...