循环拼接List并以逗号间隔

时间:2025-02-21 07:24:41
package list;

import ;
import ;

public class list {
	public static void main(String[] args) {
		
		
		List<String> resultList = new ArrayList<String>();
		("a1");
		("a2");
		("a3");
		("a4");
			StringBuffer resultBuffer = new StringBuffer();
			for (int i = 0; i < (); i++) {
				String result = (i);
				if (i == 0) {
					(result);
				} else {
					("," + result);
				}
			}
		String	testResult = ();
		(testResult);
		}

}
List<Integer> deleteOrderGoodsIds = new ArrayList<>();
.(deleteOrderGoodsIds,",");