Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.*;

public class Main {
    public static <T> void addAllInReverseOrder(Collection<T> destination, List<T> source) {
        for (int i = source.size() - 1; i >= 0; i--) {
            T object = source.get(i);
            destination.add(object);
        }
    }

    public static <T> void addAllInReverseOrder(List<T> destination, int index, List<T> source) {
        for (int i = source.size() - 1; i >= 0; i--) {
            T object = source.get(i);
            destination.add(index, object);
        }
    }
}