list转long[]数组

//list转long数组
List<Long> list = new ArrayList<>(); Long[] skuIds = list.toArray(new Long[list.size()]); //list转string数组 List<String> list = new ArrayList<String>(); list.add("a1"); list.add("a2"); String[] toBeStored = list.toArray(new String[list.size()]); for (String str : toBeStored) { System.out.println(str); }

 

posted @ 2020-08-31 11:36  红尘沙漏  阅读(2175)  评论(0编辑  收藏  举报