how to get to the end of an arraylist in java code example Example: java last element in array arrayName[arrayName.length() - 1];