Java Utililty Methods Array Equal

List of utility methods to do Array Equal

Description

The list of methods to do Array Equal are organized into topic(s).

Method

booleanequals(byte[] a1, byte[] a2)
equals
return Arrays.equals(a1, a2);
booleanequals(byte[] data1, byte[] data2)
equals
return Arrays.equals(data1, data2);
booleanequals(byte[] first, byte[] second)
This function compares two byte arrays to see if they are equal.
return Arrays.equals(first, second);
booleanequals(byte[] first, byte[] second)
equals
return Arrays.equals(first, second);
booleanequals(char[] left, int offsetLeft, char[] right, int offsetRight, int length)
See if two array slices are the same.
if ((offsetLeft + length <= left.length) && (offsetRight + length <= right.length)) {
    for (int i = 0; i < length; i++) {
        if (left[offsetLeft + i] != right[offsetRight + i]) {
            return false;
    return true;
return false;
booleanequals(char[] left, int offsetLeft, char[] right, int offsetRight, int length)
See if two array slices are the same.
if ((offsetLeft + length <= left.length) && (offsetRight + length <= right.length)) {
    for (int i = 0; i < length; i++) {
        if (left[offsetLeft + i] != right[offsetRight + i]) {
            return false;
    return true;
return false;
booleanequals(char[] str1, char[] str2)
equals
return Arrays.equals(str1, str2);
booleanequals(char[][] c1, char[][] c2)
Compares two two-dimensional char arrays for equalty.
if (c1 == c2)
    return true;
if (c1 == null || c2 == null)
    return false;
int length = c1.length;
if (c2.length != length)
    return false;
for (int i = 0; i < length; i++)
...
booleanequals(Collection asCollection, String[] values)
Compare a collection of strings to an array of strings.
final List<String> asList = Arrays.asList(values);
final boolean containsAll = asCollection.containsAll(asList);
final int size = asCollection.size();
final int length = values.length;
return containsAll && length == size;
booleanequals(double[][] xs, double[][] ys)
Tests two double[][] arrays for having equal contents.
if (xs == null)
    return ys == null;
if (ys == null)
    return false;
if (xs.length != ys.length)
    return false;
for (int i = xs.length - 1; i >= 0; i--) {
    if (!Arrays.equals(xs[i], ys[i]))
...