Reverse an Array : Array SubArray « Collections Data Structure « Java
- Java
- Collections Data Structure
- Array SubArray
Reverse an Array
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class Util{
public static <T> List<T> reverse(T[] array)
{
List<T> list = Arrays.asList(array);
Collections.reverse(list);
return list;
}
}
Related examples in the same category