Convert String Array Object to String List Object Java

In this tutorial, We will show you How to convert String Array Object to String List Object Java. The program is tested and output is shared in the same post.

package com.dineshkrish;
import java.util.Arrays;
import java.util.List;
public class ArrayToList {
public static void main(String[] args) {
String[] strArray = {
// Converting Array Object to List Object
List<String> strList = Arrays.asList(strArray);
// Printing Converted List Object


[One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten]


No responses yet

Leave a Reply

Your email address will not be published. Required fields are marked *