Answer:
class Main {
public static boolean verify(int[] a) {
for(int i=0;i<a.length/2;i++) {
if (a[i] != a[a.length-i-1]) {
return false;
}
}
return true;
}
public static void main(String[] args) {
int arr1[] = {12, 32, 67, 32, 12};
int arr2[] = {1, 2, 3, 4, 5};
System.out.println("arr1: " + (verify(arr1) ? "True" : "False"));
System.out.println("arr2: " + (verify(arr2) ? "True" : "False"));
}
}
Step-by-step explanation:
This is called a palindrome.