String[] 转List

String[] 转List<String>

String[] idArr = ids.split(",");
List<String> idList = new ArrayList<String>();
Collections.addAll(idList, idArr);

 List<String>转String[]

List<String> list= new ArrayList<String>();
String[] strings = new String[list.size()];
list.toArray(strings);

 

你可能感兴趣的:(String[] 转List)