Java集合-概述

  • Collection
    • List
      • ArrayList
      • LinkedList
    • Set
      • HashSet:基于HashMap
      • LinkedHashSet
  • Map
    • HashMap
    • LinkedHashMap
      • 继承HashMap,Entry中新增before和after属性,在newNode过程中额外处理,使得Iterator有序遍历
    • Hashtable
      • 与HashMap类似,线程同步,性能低
    • TreeMap
      • Comparator或Comparable,红黑树排序
  • 同步
    • 同步集合类:Hashtable、Vector
    • 同步封装类:Collections.synchronizedMap()、Collections.synchronizedList()
    • 整个集合加单锁,为防止ConcurrentModificationException,在迭代时将集合锁定,性能低
  • ConcurrentModificationException
    • iterator.next时,对list做写操作,引起modCount和expectedModCount不相等,抛ConcurrentModificationException
    • iterator.remove是可以的,因其末尾有expectedModCount = modCount
  • System.arraycopy
    • C++和汇编的结合,提升数组复制效率
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Eddy咸鱼

感谢大佬加鸡蛋~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值