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.List;

public class Main {
    public static <T> List<T> limit(List<T> source, int size) {
        List<T> dest = new ArrayList<>();
        for (int i = 0; i < size; i++) {
            dest.add(source.get(i));
        }
        return dest;
    }

    public static <T> void add(List<? super T> source, Object o) {
        source.add((T) o);
    }
}