Here you can find the source of reverse(T[] array)
public static <T> T[] reverse(T[] array)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { public static <T> T[] reverse(T[] array) { T[] sub = Arrays.copyOf(array, array.length); for (int i = 0; i < array.length; i++) { sub[i] = array[array.length - i - 1]; }//from w w w .j av a2 s . c om return sub; } }