1// You can't just do String.join(", ", list) because
2// the list has to be a String[]. This code works on
3// everything.
4
5list.stream().map(Object::toString).collect(Collectors.joining(", "));
1List<String> list = Arrays.asList("a","b","c");
2String result = String.join(",", list);
3
4System.out.println(result); //prints a,b,c