Output:
Click Here For Java Online Compiler
Solution:
*** Convert Array to ArrayList *** Converted to ArrayList: [Alee, Ahmed, Shakoor, Umar, Anwar, Jawad]
Click Here For Java Online Compiler
Solution:
import java.util.ArrayList; import java.util.Arrays; public class ConvertArrayToArrayList { public static void main(String[] args) { String[] array = new String[]{"Alee", "Ahmed", "Shakoor", "Umar", "Anwar", "Jawad"}; ArrayList<String> list = new ArrayList<String>(Arrays.asList(array)); System.out.println("*** Convert Array to ArrayList ***" + "\n"); System.out.println("Converted to ArrayList: "); System.out.println(list); } }
comment 0 comments:
more_vertsentiment_satisfied Emoticon