How to Convert Array to ArrayList In java:
import java.util.ArrayList;
import java.util.Arrays;
public class ArrayToArrayList {
public static void main(String[] args) {
String [] brr ={"HTML","PHP","JAVA","C"};
ArrayList<String> arr= new ArrayList<String>(Arrays.asList(brr));
System.out.println("ArrayList Is ="+arr);
}
}
Output:
ArrayList Is =[HTML, PHP, JAVA, C]
No comments:
Post a Comment