Java tutorial
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Array; public class Main { public static Object[] invert(Object[] array, Class aType) { int length = array.length; Object[] invertedArray = (Object[]) Array.newInstance(aType, length); for (int i = 0; i < invertedArray.length; i++) invertedArray[i] = array[length - i - 1]; return invertedArray; } }