Comparing Two Arrays Using build-in function "deepEquals"

 

import java.util.*;

public class ArraysEqualOrNot4 {
public static boolean compareArray(int[][] a, int[][] b) {
if (Arrays.deepEquals(a, b)) {
return true;
} else {
return false;
}
}

public static void main(String args[]) {
int[][] arr1 = { { 1, 2, 3, }, { 3, 4, 5 }, { 6, 7, 8 } };
int[][] arr2 = { { 1, 2, 3, }, { 3, 4, 5 }, { 6, 7, 8 } };
int[][] arr3 = { { 1, 2, 3, }, { 3, 4, 4 }, { 6, 7, 8 } };

boolean equalsOrNot = compareArray(arr1, arr2);
if (equalsOrNot) {
System.out.println("Both arrays are equal");
} else {
System.out.println("Both arrays are not equal");
}

equalsOrNot = compareArray(arr1, arr3);
if (equalsOrNot) {
System.out.println("Both arrays are equal");
} else {
System.out.println("Both arrays are not equal");
}
}
}

Google Script for Data Entry Form in Google Spreadsheet

// function to validate the entry made by user in user form function validateEntry (){ // declare a variable and referernece of active goog...