创建一个hashset对象
时间: 2023-09-12 09:11:45 浏览: 107
要创建一个HashSet对象,可以使用以下代码:
HashSet<Object> set = new HashSet<>();
这将创建一个名为"set"的HashSet对象实例,底层使用HashMap来实现。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [集合set接口具体实现类:HashSet](https://blog.csdn.net/m0_63404275/article/details/126969342)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [HashSet、TreeSet、TreeMap实现原理](https://blog.csdn.net/cristianoxm/article/details/105611020)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文