listjava how to get the last object in array code example Example: java last element in array arrayName[arrayName.length() - 1];