In Java 8 or later:

String listString = String.join(", ", list);

In case the list is not of type String, a joining collector can be used:

String listString = list.stream().map(Object::toString)
                        .collect(Collectors.joining(", "));
Answer from Vitalii Fedorenko on Stack Overflow
🌐
Programiz
programiz.com › java-programming › library › arraylist › tostring
Java ArrayList toString() | Programiz
March 12, 2024 - The Java ArrayList toString() method converts an arraylist into a String.
🌐
Vultr
docs.vultr.com › java › standard library › java › util › arraylist › tostring()
Java ArrayList toString() - Convert To String
November 19, 2024 - Initialize an ArrayList. Add elements to the list. Call the toString() method to convert the list into a string. ... import java.util.ArrayList; ArrayList<String> colors = new ArrayList<>(); colors.add("Red"); colors.add("Green"); ...
🌐
GeeksforGeeks
geeksforgeeks.org › java › convert-an-arraylist-of-string-to-a-string-array-in-java
Convert an ArrayList of String to a String Array in Java - GeeksforGeeks
July 11, 2025 - Fetch each element of the ArrayList one by one using get() method. Assigned each element into String Array using assignment(=) operator. Printing string array. ... // Java Program to Convert ArrayList to Array // using toArray() Method // Importing ...
🌐
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 - Since its introduction in Java 8, the Stream API has become a staple of Java development. The basic operations like iterating, filtering, mapping sequences of elements are deceptively simple to use.
🌐
Coderanch
coderanch.com › t › 377381 › java › convert-ArrayList-Strings-String
convert an ArrayList of Strings into String[] ? (Java in General forum at Coderanch)
July 31, 2005 - ArrayList aL = getStringObj(); But "aL.toArray();" can only return me an array of Objects ? Of course, I can do Iterator i = aL.iterator(); String s = new String[aL.size()]; int i = 0; while(i.hasNext()) { s[i++] = i.next().toString(); } return s; where "s" is an array of Strings.
🌐
W3Schools
w3schools.com › java › java_arraylist.asp
Java ArrayList
Elements in an ArrayList are actually objects. In the examples above, we created elements (objects) of type "String". Remember that a String in Java is an object (not a primitive type). To use other types, such as int, you must specify an equivalent wrapper class: Integer.
Find elsewhere
🌐
Dot Net Perls
dotnetperls.com › convert-arraylist-string-java
Java - Convert ArrayList to String - Dot Net Perls
Then We use String.join to convert the ArrayList into a single string. We use a comma delimiter. Result The ArrayList's contents are now represented in a string with comma character delimiters. import java.util.ArrayList; public class Program { public static void main(String[] args) { // Create ...
🌐
GeeksforGeeks
geeksforgeeks.org › java › convert-a-string-to-a-list-of-characters-in-java
Convert a String to a List of Characters in Java - GeeksforGeeks
September 2, 2026 - The get() method returns the character at the requested index, while size() returns the length of the String. No separate collection is created to store the characters. Note: This approach creates a view over the String rather than copying all characters into a separate ArrayList.
🌐
GeeksforGeeks
geeksforgeeks.org › java › how-to-convert-a-string-to-arraylist-in-java
How to Convert a String to ArrayList in Java? - GeeksforGeeks
July 23, 2025 - Converting String to ArrayList means each character of the string is added as a separator character element in the ArrayList.
🌐
Baeldung
baeldung.com › home › java › java string › convert a comma separated string to a list in java
Convert a Comma Separated String to a List in Java
September 3, 2025 - The split method we used to split our string of integers (ranks) uses zero as the limit, and so it ignores the empty strings, whereas the split used on the countries string retains empty strings in the returned array. Now, we’ll implement the same conversions using the Java Stream API.
🌐
Spiceworks
community.spiceworks.com › programming & development
to convert string into arraylist - Programming & Development - Spiceworks Community
October 5, 2008 - Hi, I need a java code to convert string into Arraylist.Reply me as soon as you can.Thanks.
🌐
BeginnersBook
beginnersbook.com › 2015 › 05 › java-string-to-arraylist-conversion
Java – How to Convert a String to ArrayList
September 20, 2022 - We are splitting the string based on comma (,) as delimiter to get substrings. These substrings are assigned to ArrayList as elements. import java.util.ArrayList; import java.util.List; import java.util.Arrays; public class JavaExample { public static void main(String args[]){ String num = "22,33,44,55,66,77"; String str[] = num.split(","); List<String> al = new ArrayList<String>(); al = Arrays.asList(str); for(String s: al){ System.out.println(s); } } }
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › util › ArrayList.html
ArrayList (Java Platform SE 8 )
July 21, 2026 - Java™ Platform Standard Ed. 8 ... public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomAccess, Cloneable, Serializable · Resizable-array implementation of the List interface. Implements all optional list operations, and permits all elements, including null. In addition to implementing the List interface, this class provides methods to manipulate the size of the array that is used internally to store the list.
🌐
Coderanch
coderanch.com › t › 40 › 379449 › java › String-array-arraylist
String array to arraylist (Java in General forum at Coderanch)
June 7, 2012 - If you only need read access to the array as if it is a List and you don't want to add or remove elements from the list, then use Garrett's solution. Otherwise use Ernest's or Janarthan's solution. As of Java 8: String [] strings = {"one", "two", "three"}; Note, this is already explained in ...
🌐
College Board
apcentral.collegeboard.org › media › pdf › ap-computer-science-a-java-quick-reference.pdf pdf
___________________________________________________ AP ® Computer Science A
This table contains accessible methods from the Java library that may be included on the AP Computer Science A Exam. Class Constructors and Methods · Explanation · String Class · String(String str) Constructs a new String object that represents the same sequence of · characters as str · int length() Returns the number of characters in a String object · String substring(int from, int to) Returns the substring beginning at index from and ending at index ·
🌐
BeginnersBook
beginnersbook.com › 2013 › 12 › how-to-convert-arraylist-to-string-array-in-java
How to convert ArrayList to string array in java
We are converting this arraylist ... names.add("Harsh"); names.add("John"); // ArrayList to Array Conversion using toArray() String arr[]=names.toArray(new String[names.size()]); //Print array elements for(String str: arr) { System.out.println(str); } } }...
🌐
TutorialsPoint
tutorialspoint.com › article › convert-an-arraylist-of-string-to-a-string-array-in-java
Convert an ArrayList of String to a String array in Java
September 25, 2019 - import java.util.*; public class Demo { public static void main(String[] args) { ArrayList<String> arrList = new ArrayList<String>(); arrList.add("Bentley"); arrList.add("Audi"); arrList.add("Jaguar"); arrList.add("Cadillac"); arrList.add("Mazda"); arrList.add("Land Rover"); arrList.add("Porsche"); int size = arrList.size(); String res[] = arrList.toArray(new String[size]); System.out.println("String Array..."); for(String s: res) { System.out.println(s); } } }
🌐
Baeldung
baeldung.com › home › java › java string › convert an arraylist of string to a string array in java
Convert an ArrayList of String to a String Array in Java | Baeldung
March 7, 2025 - They could be String, Integer, or even mixed by different types since the Object class is the supertype of all other types. Therefore, Java throws ClassCastException and rejects the Object[] to String[] casting. So next, let’s see the right approaches to convert a string ArrayList to a string array.