1String string = list.stream().map(Object::toString).collect(Collectors.joining(""));
1ArrayList<String> al = new ArrayList<String>();
2 al.add("Hello");
3 al.add("Wor");
4 al.add("ld");
5 StringBuffer sb = new StringBuffer();
6
7 for (String s : al) {
8 sb.append(s);
9 sb.append(" ");
10 }
11 String str = sb.toString();
12 System.out.println(str);//"Hello wor ld"
1ArrayList<String> list = new ArrayList<String>();
2list.add("one");
3list.add("two");
4list.add("three");
5
6StringBuilder sb = new StringBuilder();
7for (String s : list)
8{
9 sb.append(s);
10 sb.append("\t");
11}
12
13System.out.println(sb.toString());
14