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