Putting arrays in ArrayList

This question already has an answer here:

  • Create ArrayList from array 32 answers

  • You need to use Arrays.asList() function.

    String[] strings = {"ex","okay",};
    
    ArrayList newStringslist = new ArrayList<Element>(Arrays.asList(strings))
    

    Tutorials-Point Link

    Also - Create ArrayList from array


    new ArrayList<Element>(Arrays.asList(array)) -- JAVA

    per answer at Create ArrayList from array

    链接地址: http://www.djcxy.com/p/17644.html

    上一篇: 将数组转换为数组列表

    下一篇: 将数组放入ArrayList中