write a method called getlastelement that returns the last element of the given array in java code example Example: java last element in array arrayName[arrayName.length() - 1];