Java Array Reverse reverse(T[] array)

Here you can find the source of reverse(T[] array)

Description

reverse

License

Open Source License

Declaration

public static <T> T[] reverse(T[] array) 

Method Source Code

//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;
    }
}

Related

  1. ArraysReverse(byte[] array)
  2. getReverseOffsets(long fileLength, long position, byte[] buffer, int size)
  3. reverse(T[] array)
  4. reverse(T[] array)
  5. reverse(T[] array)
  6. reverse(T[] array)
  7. reverse(T[] originalArray)
  8. reverseArray(final T[] arr)
  9. reverseArray(Object[] arr)