Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String join(Object... objs) {
        if (objs == null)
            return "";
        StringBuffer s = new StringBuffer();
        for (int i = 0, n = objs.length; i < n; i++) {
            s.append(objs[i]);
            if (i != n - 1)
                s.append(",");
        }
        return s.toString();
    }

    public static String join(int[] objs) {
        if (objs == null)
            return "";
        StringBuffer s = new StringBuffer();
        for (int i = 0, n = objs.length; i < n; i++) {
            s.append(objs[i]);
            if (i != n - 1)
                s.append(",");
        }
        return s.toString();
    }

    public static String join(long[] objs) {
        if (objs == null)
            return "";
        StringBuffer s = new StringBuffer();
        for (int i = 0, n = objs.length; i < n; i++) {
            s.append(objs[i]);
            if (i != n - 1)
                s.append(",");
        }
        return s.toString();
    }
}