list和数组互转

数组转list 

String[] arrays = new String[]{"a", "b", "c"};
        List listStrings = Stream.of(arrays).collector(Collectors.toList());

或者 String[] arrays = new String[]{"a", "b", "c"};
        List listStrings = Arrays.asList(arrays);

 

list转数组

String[] ss = listStrings.stream().toArray(String[]::new);

或者

String[] sss = listStrings.toArray(new String[listStrings.size()]);

你可能感兴趣的:(java,操作记录,操作记录)