4
Java 中将列表转换为Long[]数组两种方法
source link: https://www.jdon.com/67863.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Java 中将列表转换为Long[]数组两种方法
23-08-16
banq
1、使用List.toArray()方法:
List<Long> list = Arrays.asList(1L, 2L, 3L, 4L, 5L); |
2、mapToLong()方法
List<Long> list = Arrays.asList(1L, 2L, 3L, 4L, 5L); |
或:
List<Long> list = Arrays.asList(1L, 2L, 3L, 4L, 5L); |
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK