String str="1,2,3,11" ;
String temp[] = str.split(",") ;
List lst = new ArrayList() ;
Arrays.asList(temp) ;//把数组转换为list
Arrays.sort(temp) ; //对数组对象排序
lst.toArray() //list转换为数组
java下list和数组的关系
最新推荐文章于 2023-07-25 20:17:44 发布
String str="1,2,3,11" ;
String temp[] = str.split(",") ;
List lst = new ArrayList() ;
Arrays.asList(temp) ;//把数组转换为list
Arrays.sort(temp) ; //对数组对象排序
lst.toArray() //list转换为数组