how to get last element in a list java code example
Example: java get last element of list
ArrayList<Integer> list = new ArrayList<Integer>(5);
int last = list.get(list.size() - 1);
ArrayList<Integer> list = new ArrayList<Integer>(5);
int last = list.get(list.size() - 1);