None of the existing answers involve using a comparator, and therefore cannot be used in binary trees or for sorting. So I'm just gonna leave this here:
public static int compareIntArrays(int[] a, int[] b) {
if (a == null) {
return b == null ? 0 : -1;
}
if (b == null) {
return 1;
}
int cmp = a.length - b.length;
if (cmp != 0) {
return cmp;
}
for (int i = 0; i < a.length; i++) {
cmp = Integer.compare(a[i], b[i]);
if (cmp != 0) {
return cmp;
}
}
return 0;
}