programming-examples/java/Basics/create list using an Array in java.java

17 lines
430 B
Java
Raw Normal View History

2019-11-18 14:44:36 +01:00
package com.c4learn;
import java.util.Arrays;
import java.util.List;
public class ArrayDemo1 {
public static void main (String args[]) {
// Create an array of strings
String arr[] = new String[]{"A","B","C","D"};
List list1 = Arrays.asList(arr);
// Print the list
System.out.println("Value of Array :" + list1);
}
}