how to refere to the last element of an array code example
Example: last element of an array
int[] array = {1,2,3};
System.out.println(array[array.length - 1]);
int[] array = {1,2,3};
System.out.println(array[array.length - 1]);