ArrayList<String>list=new ArrayList<>();
//集合转为数组
int size = list.size();
String[]userId= (String[]) list.toArray(new String[size]);
Java 集合转数组(String类型)
最新推荐文章于 2024-09-07 11:49:04 发布
ArrayList<String>list=new ArrayList<>();
//集合转为数组
int size = list.size();
String[]userId= (String[]) list.toArray(new String[size]);