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 CovertArrayToList.java”]List : [One, Two, Three, Four, Five]
[/su_box]
More from my site

Hello, folks, I am a founder of idineshkrishnan.com. I love open source technologies, If you find my tutorials are useful, please consider making donations to these charities.
No responses yet