print last leement of the array code example
Example 1: how to get last element of array
return array[array.length - 1];
Example 2: how to find last element in array
int [] y={1,2,3,4,5};
int c=(n.length-1);
return array[array.length - 1];
int [] y={1,2,3,4,5};
int c=(n.length-1);