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