How to Check two array equal

Program:

ArrayEqualityCheck.java

		  				import java.util.Arrays;

						public class ArrayEqualityCheck {
						
							public static void main(String[] args) {
								Integer[] arr1 = { 32, 45, 65, 12, 32, 90, 54, 43, 11, 65 };
								Integer[] arr2 = { 32, 45, 65, 12, 32, 90, 54, 43, 11, 65 };
						
								Boolean isEqual = true;
								if (arr1.length == arr2.length) {
									for (int i = 0; i < arr1.length; i++) {
										if (arr1[i] != arr2[i]) {
											isEqual = false;
											break;
										}
									}
								} else {
									isEqual = false;
								}
								if (isEqual) {
									System.out.println("arr1 and arr2 are equal");
								} else {
									System.out.println("arr1 and arr2 are not equal");
								}
						
								// Using equals()
								if (Arrays.equals(arr1, arr2)) {
									System.out.println("arr1 and arr2 are equal");
								}else{
									System.out.println("arr1 and arr2 are not equal");
								}
						
								// Using deepEquals()
								if (Arrays.deepEquals(arr1, arr2)) {
									System.out.println("arr1 and arr2 are equal");
								} else {
									System.out.println("arr1 and arr2 are not equal");
								}
							}
						}
		  			

OUTPUT:

arr1 and arr2 are equal
arr1 and arr2 are equal
arr1 and arr2 are equal