Newsletter |
How to Convert String Array to List in Java
Core Java » on Oct 16, 2016 { 1 Comment } By Sivateja
Its very often scenario to convert String Array to list in real time projects . In java we have inbuilt function to convert String array to List.
Syntax:
Arrays.asList(“Input String array“);
Java String Array to List Example
import java.util.Arrays; import java.util.List; public class RemoveNonNumeric { public static void main(String[] args) { String[] str = {"Java4s","Siva"}; List<String> list = Arrays.asList(str); System.out.println(list); } }
Output: [Java4s, Siva]
You Might Also Like
::. About the Author .:: | ||
Comments
One Response to “How to Convert String Array to List in Java”
After Completion of convert i want to add one more value into List is it possible