1int [] numbers = {1, 2, 3, 4, 5};
2
3firstElement = numbers[0];
4lastElement = numbers[numbers.length-1];
1int[] arr = new int[5]; //length of the array is 5
2int val = arr[arr.length - 1]; //here variable val stores the last element of arr
1// GIVE FIRST NUMBER AND LAST NUMBER
2firstNum = numbers[0];
3lastNum = numbers[numbers.length-1];