package com.javatraineronline;
import java.util.Arrays;
import java.util.List;
public class CovertArrayToList {
public static void main(String[] args) {
// Declaring String Array 
String[] array = {"One", "Two", "Three", "Four", "Five"};
// Converting Array Object to List Object
List<String> list = Arrays.asList(array);
// Printing the Converted List Object
System.out.println("List : "+list);

[su_box title=”Output for”]List : [One, Two, Three, Four, Five]



No responses yet

Leave a Reply

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