3
我正在学习如何使用Java 8流。 2连接每个其他数组元素
public static void clump(ArrayList strList)
{
for(int i = 0; i < strList.size() - 1; i++)
{
String newStr = "(" + strList.get(i) + " "
+ strList.get(i + 1) + ")";
strList.set(i, newStr);
strList.remove(i + 1);
}
}