在存储多个数据时可以考虑 集合和数组,它们是存储在内存中,也就是断电后就消失了。
特点 | 缺点 |
---|---|
一旦初始化,长度确定 | 长度不可变 |
数据是紧密排列的,有序的,可重复的 | 存储数据类型单一,对无序、不可重复存储比较困难 |
元素的类型可以是基本数据类型也可以是引用数据类型 | 可用的方法、属性极少 |
子接口
List:有序的、可以重复的数据(相当于“动态”数组)
具体实现类: ArrayList(主要实现类,底层还是数组)、LinkedList、Vector
Set:存储无序的、不可重复的数据(不可重复)
具体实现类:HashSet(主要实现类)、LinkedHashSet、TreeSet
Set底层就是Map,所以名字都一样
具体实现类:HashMap(主要实现类)、LinkedMap、TreeMap、Hashtable、Properties
层次1:针对于具体的多个数据,知道适用的实现类、接口。
层次2:区分不同的接口、实现类之间的区别 (面试题)
层次3:了解不同实现类的底层数据结构
推荐阅读:
vue.js:634 [Vue warn]: Property or method "userName" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See:
SpringBoot 整合 webapp时 访问404的解决办法
状态码:415,发送HTTP请求返回415状态码的解决办法
SpringCloud怎么调用多个服务的信息
Vue 打开页面时就加载方法,例如查询
Spring整合Mybatis
SpringCloud 加入 thymleaf前端页面的方法
Controller之间的跳转
Spring AOP的实现原理
This may be the result of an unspecified view, due to default view name generation
行动消除疑虑