Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    /**
     * To Array
     * 
     * @param c
     *            Collection
     * @return T[]
     */
    @SuppressWarnings("unchecked")
    public static <T> T[] toArray(Collection<T> c) {
        if (c == null) {
            return null;
        }
        return (T[]) c.toArray(new Object[c.size()]);
    }
}