Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

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

public class Main {
    /**
     * Creates a list of values
     *
     * @param items Items to store in the list
     * @param <T>   Type of value stored in the list
     * @return A list of values
     */
    @SafeVarargs
    public static <T> List<T> listOf(T... items) {
        List<T> results = new ArrayList<>(items.length);
        Collections.addAll(results, items);

        return results;
    }
}