首页 > 技术文章 > Java List和Array之间的转换(转载)

lzh1043060917 2021-09-12 14:26 原文

https://blog.csdn.net/lpq374606827/article/details/93203927

当List转化为数组时,如果想转化为二维数组:

List<int[]> res = new ArrayList<>();
res.toArray(new int[res.size()][]);
详见力扣56题,合并区间。
https://leetcode-cn.com/problems/merge-intervals/

推荐阅读