java how to remove the last element in the array code example Example: java remove last array element Arrays.copyOf(original, original.length-1)