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 {
    /**
     * Converts the specified Array to an unmodifiable List containing the same elements.
     *
     * @param source Array of Objects to be converted to an unmodifiable List.
     * @return List of Objects containing the elements of the specified Array.
     */
    public static <E> List<E> unmodifiableList(E... source) {
        return Collections.unmodifiableList(Arrays.asList(source));
    }
}