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 .::

Java4s_Author
Sivateja Kandula - Java/J2EE Full Stack Developer
Founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog, Love Java and UI frameworks.
You can sign-up for the Email Newsletter for your daily dose of Java tutorials.

Comments

One Response to “How to Convert String Array to List in Java”
  1. Suresh says:

    After Completion of convert i want to add one more value into List is it possible

Name*
Mail*
Website



By posting your answer, you agree to our comments policy.
Most Recent Posts from Top Categories
Spring Boot Hibernate Spring
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2024 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.