One simple way is to append your list items in a StringBuilder

List<Integer> list = new ArrayList<>();
list.add(1);
list.add(2);
list.add(3);

StringBuilder b = new StringBuilder();
list.forEach(b::append);

System.out.println(b);

you can also try:

String s = list.stream().map(e -> e.toString()).reduce("", String::concat);

Explanation: map converts Integer stream to String stream, then its reduced as concatenation of all the elements.

Note: This is normal reduction which performs in O(n2)

for better performance use a StringBuilder or mutable reduction similar to F. Bรถller's answer.

String s = list.stream().map(Object::toString).collect(Collectors.joining(","));

Ref: Stream Reduction

Answer from Shailesh Aswal on Stack Overflow
๐ŸŒ
Java Code Geeks
javacodegeeks.com โ€บ home โ€บ core java
Java 8 - Converting a List to String with Examples - Java Code Geeks
July 5, 2021 - First, we will understand how to make List to String using toString() method. Next, Collection to String with comma separator or custom delimiter using Java 8 Streams Collectors api and String.join() method.
๐ŸŒ
Java Guides
javaguides.net โ€บ 2024 โ€บ 09 โ€บ java-8-convert-list-of-strings-to-single-string.html
Java 8 โ€“ Convert List of Strings to a Single String
September 9, 2024 - In Java 8, converting a list of strings into a single string is easy with the Stream API and Collectors.joining().
People also ask

What are some common issues faced when converting a list to a string in Java?
Common issues include handling null values, adding unnecessary commas, and managing formatting.
๐ŸŒ
tracedynamics.com
tracedynamics.com โ€บ list-to-string-java
Convert List to String Java : 10+ Methods (ArrayList, String)
How can you remove brackets when converting a list to a string in Java?
Use a string joiner or a string builder to concatenate elements without brackets.
๐ŸŒ
tracedynamics.com
tracedynamics.com โ€บ list-to-string-java
Convert List to String Java : 10+ Methods (ArrayList, String)
What are the differences between hashmap and hashtable in Java?
HashMap is not synchronized and allows one null key, while Hashtable is synchronized and doesn't allow null keys or values.
๐ŸŒ
tracedynamics.com
tracedynamics.com โ€บ list-to-string-java
Convert List to String Java : 10+ Methods (ArrayList, String)
๐ŸŒ
Mkyong
mkyong.com โ€บ home โ€บ java โ€บ java 8 stream โ€“ convert list> to list
Java 8 Stream โ€“ Convert List<List<String>> to List<String> | mkyong.com
July 18, 2019 - package com.mkyong.test; import java.util.Arrays; import java.util.List; import java.util.Scanner; import java.util.stream.Collectors; public class Java9Example2 { public static void main(String[] args) { List<String> numbers = Arrays.asList("1", "2", "A", "B", "C1D2E3"); List<String> collect = numbers.stream() .map(x -> new Scanner(x).findAll("\\D+") .map(m -> m.group()) .collect(Collectors.toList()) ) // List<List<String>> .flatMap(List::stream) // List<String> .collect(Collectors.toList()); collect.forEach(x -> System.out.println(x)); } }
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ java โ€บ java string โ€บ converting a list to string in java
Converting a List to String in Java | Baeldung
July 30, 2026 - A solid grasp of the fundamentals will go a long way to help minimize these issues. Get started with understanding multi-threaded applications with our Java Concurrency guide: ... Since its introduction in Java 8, the Stream API has become a staple of Java development.
๐ŸŒ
Java2Blog
java2blog.com โ€บ home โ€บ conversion โ€บ java list to string
Java List to String - Java2Blog
October 18, 2021 - StringBuilder is the best approach ... can add elements in the object of StringBuilder using the append() method while looping and then convert it into string using toString() method of String class at the end....
๐ŸŒ
Javaprogramto
javaprogramto.com โ€บ 2021 โ€บ 06 โ€บ java-8-convert-list-to-string.html
Java 8 - Converting a List to String with Examples JavaProgramTo.com
November 11, 2021 - First, we will understand how to make List to String using toString() method. Next, Collection to String with comma separator or custom delimiter using Java 8 Streams Collectors api and String.join() method.
Find elsewhere
๐ŸŒ
TraceDynamics
tracedynamics.com โ€บ list-to-string-java
Convert List to String Java : 10+ Methods (ArrayList, String)
December 15, 2023 - Mastering different techniques like Java 8 streams and the String.join() method empowers you to handle both simple list-to-string conversions and complex scenarios involving multiple elements, null values, and custom formatting.
๐ŸŒ
Reverse Coding
reversecoding.net โ€บ java-8-convert-list-string-comma
Java 8 - Convert List to String comma separated | Reverse Coding
May 22, 2016 - The best way to learn itโ€™s playing! Copy this class with all the implementations discussed and play with that. There is already a small test for each of them ๐Ÿ™‚ ยท package net.reversecoding.examples; import static java.util.stream.Collectors.joining; import static org.junit.Assert.assertEquals; import java.util.Arrays; import java.util.List; import org.junit.Test; public class CsvUtil { private static final String SEPARATOR = ","; public static String toCsv(List<String> listToConvert){ return String.join(SEPARATOR, listToConvert); } @Test public void toCsv_csvFromListOfString(){ List<Strin
๐ŸŒ
DZone
dzone.com โ€บ coding โ€บ java โ€บ convert a list to a comma-separated string in java 8
Convert a List to a Comma-Separated String in Java 8 - DZone
June 29, 2016 - This tutorial demonstrates how to use streams in Java 8 and Java 7 to convert a list to a comma-separated string by manipulating the string before joining.
๐ŸŒ
Javatpoint
javatpoint.com โ€บ convert-list-to-string-in-java
Convert List to String in Java - Javatpoint
Convert List to String in Java with java tutorial, features, history, variables, object, programs, operators, oops concept, array, string, map, math, methods, examples etc.
๐ŸŒ
amitph
amitph.com โ€บ home โ€บ java โ€บ convert list to concatenated string with delimiter in java
List of Strings to Concatenated String with Delimiter in Java | amitph
November 22, 2024 - List<String> words = Arrays.asList("Convert", "List", "of", "Strings", "To", "String"); String output = String.join(",", words); System.out.println(output); // Output: // Convert,List,of,Strings,To,StringCode language: Java (java)
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ java โ€บ java list โ€บ convert an arraylist of object to an arraylist of string elements
Convert an ArrayList of Object to an ArrayList of String Elements | Baeldung
March 7, 2025 - List<String> outputList; outputList = inputList .stream() .map((obj) -> Objects.toString(obj, null)) .collect(Collectors.toList()); Assert.assertEquals(expectedStringList, outputList); This approach works well for Java 8 and above as the Streams ...
๐ŸŒ
Mkyong
mkyong.com โ€บ home โ€บ java โ€บ java โ€“ convert arraylist to string[]
Java โ€“ Convert ArrayList<String> to String[] | mkyong.com
April 17, 2019 - package com.mkyong; import ... } } } Output ยท A B C ยท For Java 8, we can do like this : // Java 8 String[] str = list.stream().toArray(String[]::new); For Java 9, we have a new way to create a List ยท...