java get the first element of an array inside an array code example Example: java last element in array arrayName[arrayName.length() - 1];