Try something like
List<String> myList = new ArrayList<String>(Arrays.asList(s.split(",")));
Arrays.asListdocumentationString.splitdocumentationArrayList(Collection)constructor documentation
Demo:
String s = "lorem,ipsum,dolor,sit,amet";
List<String> myList = new ArrayList<String>(Arrays.asList(s.split(",")));
System.out.println(myList); // prints [lorem, ipsum, dolor, sit, amet]
Answer from aioobe on Stack OverflowGeeksforGeeks
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 - We can easily convert String to ArrayList in Java using the split() method and regular expression.
Top answer 1 of 14
341
Try something like
List<String> myList = new ArrayList<String>(Arrays.asList(s.split(",")));
Arrays.asListdocumentationString.splitdocumentationArrayList(Collection)constructor documentation
Demo:
String s = "lorem,ipsum,dolor,sit,amet";
List<String> myList = new ArrayList<String>(Arrays.asList(s.split(",")));
System.out.println(myList); // prints [lorem, ipsum, dolor, sit, amet]
2 of 14
36
String s1="[a,b,c,d]";
String replace = s1.replace("[","");
System.out.println(replace);
String replace1 = replace.replace("]","");
System.out.println(replace1);
List<String> myList = new ArrayList<String>(Arrays.asList(replace1.split(",")));
System.out.println(myList.toString());
Videos
04:40
How to convert ArrayList to String Array | Java Interview Question ...
Converting ArrayList of String to a simple 'String[]' array in ...
Filling an ArrayList of type String with Strings
Java: Convert Array to ArrayList, and ArrayList to Array
01:35
How to Convert Array to List in Java | FULL GUIDE - YouTube
07:53
Convert Array To List Efficiently in Java| Arrays.asList()|List ...
W3Schools
w3schools.com › java › java_arraylist.asp
Java ArrayList
To use an ArrayList, you must first import it from java.util: Create an ArrayList object called cars that will store strings:
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); } } }
Top answer 1 of 6
367
You can do the following:
String [] strings = new String [] {"1", "2" };
List<String> stringList = new ArrayList<String>(Arrays.asList(strings)); //new ArrayList is only needed if you absolutely need an ArrayList
2 of 6
41
Like this :
String[] words = {"000", "aaa", "bbb", "ccc", "ddd"};
List<String> wordList = new ArrayList<String>(Arrays.asList(words));
or
List myList = new ArrayList();
String[] words = {"000", "aaa", "bbb", "ccc", "ddd"};
Collections.addAll(myList, words);
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 - In this tutorial, we’ll explore how to accomplish this conversion seamlessly using Java’s built-in methods and techniques. An example can help us to understand the problem quickly. Let’s say we have the following ArrayList, which contains some artists’ names: static final List<String> INPUT_LIST = Lists.newArrayList("Michael Bolton", "Michael Jackson", "Guns and Roses", "Bryan Adams", "Air Supply");
Coderanch
coderanch.com › t › 379449 › java › String-array-arraylist
String array to arraylist (Java in General forum at Coderanch)
2. Convert the array to a list? Why can't I do this all in one statement? You can do it in one statement: ... If that's your question, then the answer is: Because arrays are part of the Java language and as such, they get special language-level treatment (kind of like Strings do). The Collections Framework (including ArrayList...
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 - Convert ArrayList to Object array using toArray() method. Iterate and convert each element to the desired type using typecasting. Here it is converted to String type and added to the string array.
Programiz
programiz.com › java-programming › examples › arraylist-string-conversion
Java Program to Convert the ArrayList into a string and vice versa
To learn more, visit Java String join(). import java.util.ArrayList; import java.util.Arrays; class Main { public static void main(String[] args) { // create a string String str = "Java, JavaScript, Python"; System.out.println("String: " + str); // convert the string into an array String[] arr = str.split(","); // create an arraylist from the string ArrayList<String> languages = new ArrayList<>(Arrays.asList(arr)); System.out.println("ArrayList: " + languages); } }
LabEx
labex.io › tutorials › java-how-to-split-a-string-into-an-arraylist-using-a-delimiter-in-java-415655
How to split a string into an ArrayList using a delimiter in Java | LabEx
This example demonstrates how to convert a string array to an ArrayList and showcases one of the advantages of using an ArrayList: the ability to easily add new elements to the collection. Note the differences between arrays and ArrayLists: Arrays have a fixed size, while ArrayLists can grow dynamically · ArrayLists provide methods like add(), remove(), and get() for manipulating elements · ArrayLists can only store objects, not primitive types (though Java automatically handles the conversion using autoboxing)
Dot Net Perls
dotnetperls.com › convert-arraylist-string-java
Java - Convert ArrayList to String - Dot Net Perls
Sometimes we want to combine just the strings in an ArrayList, with no delimiters between them. We use an empty string literal as the delimiter. import java.util.ArrayList; public class Program { public static void main(String[] args) { // Append three Strings to the ArrayList.
Baeldung
baeldung.com › home › java › java array › how to add string arrays to arraylist in java
How to Add String Arrays to ArrayList in Java | Baeldung
March 7, 2025 - final static String[] ARRAY1 = { "Java", "Kotlin", "Sql", "Javascript" }; final static String[] ARRAY2 = { "C", "C++", "C#", "Typescript" }; final static String[] ARRAY3 = { "Python", "Ruby", "Go", "Rust" }; Also, we have a method to produce a String List with two String elements: List<String> initLanguageList() { List<String> languageList = new ArrayList<>(); languageList.add("Languages"); languageList.add(":"); return languageList; }
Top answer 1 of 16
1239
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(", "));
2 of 16
425
If you happen to be doing this on Android, there is a nice utility for this called TextUtils which has a .join(String delimiter, Iterable) method.
List<String> list = new ArrayList<String>();
list.add("Item 1");
list.add("Item 2");
String joined = TextUtils.join(", ", list);
Obviously not much use outside of Android, but figured I'd add it to this thread...
Vultr
docs.vultr.com › java › standard-library › java › util › ArrayList › toString
Java ArrayList toString() - Convert To String | Vultr Docs
November 19, 2024 - In this article, you will learn ... an ArrayList into a string. Explore the default behavior of this method and how to customize it to suit specific formatting needs. Understand how this method can be used in practical scenarios to enhance data handling and representation in Java ...