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