public class CompareFirstAndLastEle {
public static void main(String args[]) {
int arr[] = { 10, 12, 13, 14, 2, 3, 5, 1 };
int firEle = arr[1];
int lastEle = arr[arr.length - 1];
if (firEle > lastEle) {
System.out.println("First element of the given Array is greater");
} else {
System.out.println("Last element of the given Array is greater");
}
}
}