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
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
04:40
How to convert ArrayList to String Array | Java Interview Question ...
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");
TutorialsPoint
tutorialspoint.com โบ how-to-get-arraylist-string-to-arraylist-object-and-vice-versa-in-java
How to get ArrayList<String> to ArrayList<Object> and vice versa in java?
Using wild cards, you can convert ArrayList<String> to ArrayList<Object> as โ ยท ArrayList<String> stringList = (ArrayList<String>)(ArrayList<?>)(list); import java.util.ArrayList; import java.util.Iterator; import java.util.ListIterator; public class ArrayListExample { public static void main(String args[]) { //Instantiating an ArrayList object ArrayList<Object> list = new ArrayList<Object>(); //populating the ArrayList list.add("apples"); list.add("mangoes"); list.add("oranges"); //Converting the Array list of object type into String type ArrayList<String> stringList = (ArrayList<String>)(ArrayList<?>)(list); //listing the contenmts of the obtained list Iterator<String> it = stringList.iterator(); while(it.hasNext()) { System.out.println(it.next()); } } }
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...
Top answer 1 of 5
340
Use this code for that,
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
public class StringArrayTest {
public static void main(String[] args) {
String[] words = {"ace", "boom", "crew", "dog", "eon"};
List<String> wordList = Arrays.asList(words);
for (String e : wordList) {
System.out.println(e);
}
}
}
2 of 5
184
new ArrayList( Arrays.asList( new String[]{"abc", "def"} ) );
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); } }
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...
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)
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 ...
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.
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.