Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.ArrayList;

public class Main {

    public static String[] trans(ArrayList<String> als) {
        String[] sa = new String[als.size()];
        als.toArray(sa);
        return sa;
    }

    public static ArrayList<String> trans(String[] sa) {
        ArrayList<String> als = new ArrayList<>(0);
        for (int i = 0; i < sa.length; i++) {
            als.add(sa[i]);
        }
        return als;
    }
}