Here you can find the source of buildFromToString(ArrayList
Parameter | Description |
---|---|
result | a parameter |
public static <T> String buildFromToString(ArrayList<T> list)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { /**/*www.j a v a2 s .c o m*/ * Used to create a string which represents the objects in an array * @param result * @return */ public static <T> String buildFromToString(ArrayList<T> list) { StringBuilder ret = new StringBuilder(); int count = 0; for (T t : list) { if (count != 0) { ret.append(", "); } ret.append(t.toString()); count++; } return ret.toString(); } }