Converting String Array to List in Java

import java.util.Arrays;
import java.util.List;

public class StringArrayList {

public static void main(String args[]) {

//Declaration of String Array
String array[]={"a","b"};

//Converting String Array to List of String values
List<String> listString=Arrays.asList(array);


System.out.println(listString);
}

}

Comments