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 {
    public static String list2String(List<Integer> list) {
        if (list == null || list.size() == 0)
            return "";
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < list.size(); i++) {
            Integer obj = list.get(i);
            sb.append(obj.toString());
            if (i != list.size() - 1)
                sb.append(",");
        }
        return sb.toString();
    }
}