Here you can find the source of reverse(final Object[] pArray)
public static final void reverse(final Object[] pArray)
//package com.java2s; public class Main { public static final void reverse(final byte[] pArray) { if (pArray == null) { return; }//from w ww. j av a 2s . com int i = 0; int j = pArray.length - 1; byte tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } public static final void reverse(final short[] pArray) { if (pArray == null) { return; } int i = 0; int j = pArray.length - 1; short tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } public static final void reverse(final int[] pArray) { if (pArray == null) { return; } int i = 0; int j = pArray.length - 1; int tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } public static final void reverse(final long[] pArray) { if (pArray == null) { return; } int i = 0; int j = pArray.length - 1; long tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } public static final void reverse(final float[] pArray) { if (pArray == null) { return; } int i = 0; int j = pArray.length - 1; float tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } public static final void reverse(final double[] pArray) { if (pArray == null) { return; } int i = 0; int j = pArray.length - 1; double tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } public static final void reverse(final Object[] pArray) { if (pArray == null) { return; } int i = 0; int j = pArray.length - 1; Object tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } }