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); }