JAVA 存放[1,2,3,4]到List中,但实际想[1],[2],[3],[4]这么存该怎么弄
用List<int[]>或者List<List<int>> list.add(new int[] { x })代替list.add(x)
相当于一个大的List集合里面又嵌套了子List集合。