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 {
    public static Long[] collectionToArray(Collection<String> collection) {
        if (collection == null || collection.isEmpty()) {
            return null;
        }
        Long[] arry = new Long[collection.size()];
        int index = 0;
        for (String value : collection) {
            arry[index++] = Long.valueOf(value);
        }
        return arry;
    }
}