您的位置 首页 java

我的编程手册 — Java 基础篇·容器

  • 程序上规定,数组(数组是对象,并非容器)是指有相同类型数据的一种集合,一般都是定长并占有的是连续空间。
  • Java Collections 框架中包含了大量集合接口(List,Queue , Set , Stack )及其实现类和一套操作集合的算法(排序,查找,替换等等)。
  • ArrayList: 底层数据结构是Objetc数组,查询快,增删慢。 线程 不安全,效率高。Vector:底层数据结构是Objetc数组,查询快,增删慢。 线程安全 ,效率低,因为它给整个方法上面添加了 synchronized ,太笨重了。LinkedList:底层数据结构是 双向链表 ,查询慢,增删快。线程不安全,效率高。
  • 迭代器 是一个轻量级的容器,主要就是选择和遍历序列中的对象。
  • 数组是通过数组下标来对内容进行 索引 的,Map 是通过对象进行索引的,用来索引的对象的是Key 。而我们常见的 HashMap ,他根据Key 的 HashCode 值存储数据(Value), 根据Key 可以直接获取到HashCode

集合

文章来源:智云一二三科技

文章标题:我的编程手册 — Java 基础篇·容器

文章地址:https://www.zhihuclub.com/169315.shtml

关于作者: 智云科技

热门文章

评论已关闭

6条评论

  1. A 2013 study done by the NIH National Institutes of Health found there is an increased risk of heart attack, stroke or other cardiovascular diseases from taking calcium supplements

  2. You people are saving me at least 50 a month Anesthesia can also cause nausea after any surgery

  3. Hormonal therapy has been the mainstay of treatment in MBC with tamoxifen the front line drug Hyperinsulinaemia occurs secondary to insulin resistance and is associated with an increased biochemical risk profile for cardiovascular disease and an increased prevalence of diabetes mellitus

  4. Red clover, in conjunction with red raspberry leaf and peppermint, can be made into a nourishing tonic that can be drank every day for better ovulation

网站地图