当前位置:网站首页>Collection summary
Collection summary
2022-04-21 18:22:00 【Adsh】
1.Collection Is a general interface of the collection class .Collection There are two sub interfaces :List and Set.Map It's an interface , But don't inherit Collection.
2.List Subclass of interface :ArrayList、LinkedList、Vector
3.Set Subclass of interface :TreeSet、HashSet、LinkedHashSet.
4.Map Subclass of interface :TreeMap、HashMap、LinkedHashMap.
5. Underlying implementation
- ArrayList: Array
- LinkedList: Linked list
- Vector: Array
- TreeSet:TreeMap TreeMap: Red and black trees
- HashSet:HashMap HashMap: Array + Linked list (jdk1.7) Array + Linked list + Red and black trees (jdk:1.8 in the future )
- LinkedHashSet: Red and black trees + Linked list
6. If you go TreeSet Add elements to the tree storage structure ( Reference object ), The comparator needs to be defined . Comparators are divided into external comparators (Comparable) And internal comparator (Comparator)
7. Add elements to the collection , You can use generics to contract the type of element you want to add . Generic class , Generic interfaces and generic methods . Yes 3 Kinds of wildcards :<?>、<? extends class>( The upper limit of generics )、<? super class>( The lower bound of generics )
8.HashMap Find elements in faster than TreeMap fast .
9.TreeMap What's stored is Key-value value ,TreeSet Yes, actually TreeMap structure , Only store key value .
版权声明
本文为[Adsh]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211821384264.html
边栏推荐
- Observe cloud landing in Alibaba cloud computing nest and build a new ISV ecosystem
- 【无标题】
- 靶机渗透练习78-Thoth Tech
- Which immortal wrote 421 pages of advanced notes on MySQL, covering all MySQL technologies! It's so sweet
- In order to offer several big factories, "closed door practice"
- 启牛app证券账户安全吗?谁在这开了?
- Golang中Json的序列化和反序列化怎么使用
- Target penetration exercise 80 momentum: 1
- Huawei, TCL, Dajiang
- Interface
猜你喜欢

Interface

C语言操作符汇总

laravel-soar(2.x) - 自动监控输出 SQL 优化建议、辅助 laravel 应用 SQL 优化

Target penetration exercise 80 momentum: 1

观测云登陆阿里云计算巢,共建ISV新生态

Target penetration exercise 72-dc4
![[dai4] the entry node of the link in jz23 linked list](/img/80/eca8951f581dc27cce9597af13e47e.png)
[dai4] the entry node of the link in jz23 linked list

Redis-benchmark性能测试工具使用详解

靶机渗透练习70-DC2

Target penetration exercise 78 Thoth Tech
随机推荐
启牛app证券账户安全吗?谁在这开了?
靶机渗透练习71-DC3
你已经用 SharedPrefrence 的 apply() 替换 commit() 了吗?
Joli langage Tommy C
MySQL——远程连接非本地MySQL数据库服务器,报错ERROR 1130: Host 192.168.3.100 is not allowed to connect to this MySQL s
Target penetration exercise 71-dc3
中介者模式
Four digit C language composed of Statistics
Redis三种特殊数据类型——bitmap位图计算
Goldfish rhca memoirs: rh358 manages DNS and DNS servers -- configuring cache name servers using unbound
人员不足、供应链断裂,危机之下制造业该如何自救?
安装网卡驱动失败(已解决)
干货 | 谁懂这篇文,玩游戏还会卡顿?
Laravel soar (2. X) - automatically monitor and output SQL optimization suggestions and assist laravel to apply SQL optimization
Interface
金鱼哥RHCA回忆录:RH358管理DNS和DNS服务器--使用Unbound配置缓存名称服务器
TCP / IP protocol
Advanced formula 47 of C language: recursive function analysis
WPF学习笔记——概述
Mycat水平分表(全局表)