How to convert Array to List in Java ?

Published on July 3, 2015 by abundantcode

Filed under Java

Last modified July 3, 2015

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 2051 times

This article will explain how to convert a simple array to list in Java .

How to convert Array to List in Java ?

The Java’s array class provides necessary methods to convert the array to the List using the asList method. Below is a sample code snippet demonstrating the usage of the Arrays.asList method to convert array to List.

package com.abundantcode;
import java.util.Arrays;
import java.util.List;
public class Main {

    public static void main(String[] args)
        String[] input = {"Java", "", "MCA Lab Programs", "B.E Java Lab Programs", "BCA Java Programs"};

        List<String> stringLst = Arrays.asList(input);




If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

1 Comment

  1. How to search array elements in Java using Binary Search ? | Abundant Code
    July 3, 2015 - 9:27 pm

Leave a Comment


You might be Interested in these Posts

How to use array Rank in C# ?

In C# , the Rank property of the array is is used to get the rank of the array. In simple terms , ra...

How to get the Number of Elements in an MultiDimensional Array in C# ?

In one of the previous articles , we demonstrated the usage of the Length property of the array in C...

How to get the Number of Elements in an Array in C# ?

You can use the Length property of the array to return the number of elements in it. Note that once ...