code: public static Object remove(Object array, int index) {
          int length = length(array);
          if (index < 0 || index >= length) {
              throw new IndexOutOfBoundsException("Index: " + index + ", Length: " + length);
          }
  
          Object result = Array.newInstance(array.getClass().getComponentType(), length - 1);
          System.arraycopy(array, 0, result, 0, index);
          if (index < length - 1) {
              System.arraycopy(array, index + 1, result, index, length - index - 1);
          }
  
          return result;
      }
docs: Removes the element at the specified position from the specified array
  
  @param array
  @param index
  @return