Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.List;

public class Main {
    /** Join into string */
    public static String join(String[] x) {
        StringBuilder sb = new StringBuilder();
        for (String token : x) {
            sb.append(token).append(" ");
        }
        return sb.toString().trim();
    }

    /** Join into string */
    public static String join(List<String> x) {
        StringBuilder sb = new StringBuilder();
        for (String token : x) {
            sb.append(token).append(" ");
        }
        return sb.toString().trim();
    }
}