Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Iterator;
import java.util.List;

public class Main {
    public static String join(List<String> paramList) {
        StringBuilder localStringBuilder = new StringBuilder(11 * paramList.size());
        Iterator localIterator = paramList.iterator();
        while (localIterator.hasNext()) {
            String str = (String) localIterator.next();
            if (localStringBuilder.length() != 0) {
                localStringBuilder.append(",");
            }
            localStringBuilder.append(str);
        }
        return localStringBuilder.toString();
    }

    public static String join(int[] paramArrayOfInt) {
        StringBuilder localStringBuilder = new StringBuilder(11 * paramArrayOfInt.length);
        int i = paramArrayOfInt.length;
        for (int j = 0; j < i; j++) {
            int k = paramArrayOfInt[j];
            if (localStringBuilder.length() != 0) {
                localStringBuilder.append(",");
            }
            localStringBuilder.append(k);
        }
        return localStringBuilder.toString();
    }

    public static String join(long[] paramArrayOfLong) {
        StringBuilder localStringBuilder = new StringBuilder(11 * paramArrayOfLong.length);
        int i = paramArrayOfLong.length;
        for (int j = 0; j < i; j++) {
            long l = paramArrayOfLong[j];
            if (localStringBuilder.length() != 0) {
                localStringBuilder.append(",");
            }
            localStringBuilder.append(l);
        }
        return localStringBuilder.toString();
    }

    public static String join(String[] paramArrayOfString) {
        StringBuilder localStringBuilder = new StringBuilder(11 * paramArrayOfString.length);
        int i = paramArrayOfString.length;
        for (int j = 0; j < i; j++) {
            String str = paramArrayOfString[j];
            if (localStringBuilder.length() != 0) {
                localStringBuilder.append(",");
            }
            localStringBuilder.append(str);
        }
        return localStringBuilder.toString();
    }
}