1int[] someArray = {1,2,3,4,5};
2int first = someArray[0];
3int last = someArray[someArray.length - 1];
4System.out.println("First: " + first + "\n" + "Last: " + last);
1// GIVE FIRST NUMBER AND LAST NUMBER
2firstNum = numbers[0];
3lastNum = numbers[numbers.length-1];
1//Size of array
2int n = 10;
3
4//Create Array
5int[] myArray = new int[n];
6
7//Access and store last element
8int lastElement = myArray[myArray.length - 1];