当前位置:网站首页>HashSet to array
HashSet to array
2022-07-24 06:49:00 【cxcaln】
Development process , We often put data into sets for operation , because java Collections provide us with a large number of methods and functions to use , It greatly reduces our development workload . But sometimes what we need is the basic data type , For example, array , At this point, we convert the collection type into an array . Although the collection class has a toArray() Method , But back Object[] type , Usually we can consider using stream Flow forward , The reference codes are as follows :
HashSet<Integer> set = new HashSet();
int[] a = set.stream().mapToInt(Integer::intValue).toArray()
边栏推荐
猜你喜欢

sql server 同步数据库 跨网段无公网ip几个常见小问题问题

File system and log analysis

Kubernetes rapid installation

安装snownlp包过程出现Requirement already satisfied:及Read timed out.问题解决方法

It's not too much to fight a landlord in idea!

类加载的过程(生命周期)详情分析
![[lvgl (5)] label usage](/img/55/f25a510cf04caff7ee15e72360c3a1.png)
[lvgl (5)] label usage

STM32 MP3 music player based on FatFs r0.14b & SD card (also a simple application of FatFs)

(静态,动态,文件)三个版本的通讯录

LM393 电压比较器及其典型电路介绍
随机推荐
SSH Remote Access and control
Process and planned task management
LM393 voltage comparator and its typical circuit introduction
【LVGL】【阶段总结1】
[lvgl (2)]
MapReduce (I)
Redis基本类型-哈希Hash
I have seven schemes to realize web real-time message push, seven!
js和ts学习总结
MapReduce(一)
Visibility:hidden and display:none
SparkSQL核心使用,220724,
Kubernetes rapid installation
反射
【媒体控制器】开源项目学习笔记(基于Arduino Micro开发板)
JS - numerical processing (rounding, rounding, random numbers, etc.)
[audio decoding chip] Application of vs1503 audio decoding chip
(static, dynamic, file) three versions of address book
数据分析思维之从整体出发分析零售行业——全方位多方面细节分析
(静态,动态,文件)三个版本的通讯录