Convert Array to List with Arrays.asList() in Java
Description
The following code shows how to convert Array to List with Arrays.asList().
Example
// w w w.j ava 2s .c o m
import java.util.Arrays;
import java.util.List;
public class Main {
public static void main(String args[]) {
List<String> list = Arrays.asList("A", "B", "C", "E", "java2s.com");
System.out.println(list);
}
}
The code above generates the following result.