Java List Reverse reverse(List list)

Here you can find the source of reverse(List list)

Description

reverse

License

BSD License

Declaration

static public <T> List<T> reverse(List<T> list) 

Method Source Code


//package com.java2s;
//License from project: BSD License 

import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;

public class Main {
    static public <T> List<T> reverse(List<T> list) {
        List<T> result = new ArrayList<T>(list.size());
        ListIterator<T> it = list.listIterator(list.size());
        while (it.hasPrevious()) {
            result.add(it.previous());// www.  j  av  a2 s. c o m
        }
        return result;
    }
}

Related

  1. reverse(List list)
  2. reverse(List list)
  3. reverse(List list)
  4. reverse(List list)
  5. reverse(List list)
  6. reverse(List src, List dst)
  7. reverse(List xs)
  8. reverse(List l)
  9. reverseCopy(Iterable list)