Java List Reverse reverse(List list)

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

Description

Create a new instance of list which has elements in reverse order

License

Open Source License

Parameter

Parameter Description
list list of String

Return

reversed list

Declaration

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

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.Collections;

import java.util.List;

public class Main {
    /**//from  w w w  .  j  a  va 2  s  .c  om
     * Create a new instance of list which has elements in reverse order
     * @param list list of String
     * @return reversed list
     */
    public static List<String> reverse(List<String> list) {
        List<String> reversedList = new ArrayList<String>(list);
        Collections.reverse(reversedList);
        return reversedList;
    }
}

Related

  1. reverse(List list)
  2. reverse(List as)
  3. reverse(List list)
  4. reverse(List source)
  5. reverse(List list)
  6. reverse(List a)
  7. reverse(List l)
  8. reverse(List list)
  9. reverse(List list)

  10. HOME | Copyright © www.java2s.com 2016