get first value in array java code example
Example 1: find last element in array in java
firstNum = numbers.get(0);
lastNum = numbers.get(numbers.size() - 1);
Example 2: arraylist get last
E e = list.get(list.size() - 1);
firstNum = numbers.get(0);
lastNum = numbers.get(numbers.size() - 1);
E e = list.get(list.size() - 1);