/** 1
* 传入List<?>返回String[]数据
* @return
*/
public static String[] getListDate(List<String> list){
String[] strs = new String[list.size()];
for (int i = 0; i < list.size(); i++) {
strs[i] = list.get(i);
}
return strs;
}
//2
String[] arr = list.toArray(new String[list.size()]);
String[] 转List<String>
String[] strs = new String[]{"22"};
List<String> list = Arrays.asList(strs);
Java List<String>和String[]互转
最新推荐文章于 2024-05-17 11:53:01 发布