Java examples for java.util:List Operation
reverse List of Integers
//package com.java2s; import java.util.Collections; import java.util.LinkedList; import java.util.List; public class Main { public static void main(String[] argv) { List aList = java.util.Arrays.asList("asdf", "java2s.com"); System.out.println(reverse(aList)); }/* w ww . j a v a 2 s .com*/ public static List<Integer> reverse(List<Integer> aList) { List<Integer> tmp = new LinkedList<>(aList); Collections.reverse(tmp); return tmp; } }