Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {
    /**
     * 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;
    }
}