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