Conversion between the array and a set of list

     Conversion arrays and collections that we often use arrays to store and easy to read, and contains a lot of rich collection method.


    An array into the collection:

       The use of static methods Arrays class asList collection methods can either be converted to a list collection

       如:String[] strs = {"one","two","three","five","six"};

               ArrayList lists = Arrays.asList(strs);


      list set into the array:

        Using a loop according to the elements in the set is inserted into the array

Guess you like

Origin blog.csdn.net/N_E_W_J_A_V_A/article/details/65431521