Here you can find the source of reverseArrayList(ArrayList listIn)
Parameter | Description |
---|---|
listIn | The ArrayList to be reversed |
public static ArrayList reverseArrayList(ArrayList listIn)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collections; public class Main { /**/*from w w w . j a va2 s .c o m*/ * This will simply reverse an ArrayList * * @param listIn * The ArrayList to be reversed * @return */ public static ArrayList reverseArrayList(ArrayList listIn) { ArrayList reversed = (ArrayList) listIn.clone(); Collections.reverse(reversed); return reversed; } }