find the last element of a list java code example
Example 1: get last element of array java
firstNum = numbers[0];
lastNum = numbers[numbers.length-1];
Example 2: how to find last element of list
L=[1,2,3,4,5]
lastElement=L[L.size()]
firstNum = numbers[0];
lastNum = numbers[numbers.length-1];
L=[1,2,3,4,5]
lastElement=L[L.size()]