集合

接口与实现分离:

迭代器:

 

 
  一点点core java的笔记-集合

 

 

for (... : q) 被翻译为带迭代器的循环。

lamba: it. for Each Remaining (elem-> { });

泛型实用方法 :

 

 
一点点core java的笔记-集合  

 

 

 

 
一点点core java的笔记-集合  

 

 

避免开发修改异常:多个只读迭代器,单个读写迭代器。

映射: Hash Map 与 Tree Map
counts. put (key , counts. getOrDefault (key,0)+ 1) P 372

优先队列: 在实现Comparable接口,存构造器中提供的Comparator对象

 

 
  一点点core java的笔记-集合

 

 

同步视图: 多线程时,用collections的synchronized Map方法可将映射表转为同步方法的 Map (在另一个线程调用前,必须完成之前 的方法)。

受查视图
List<string> safe Strings = Collections. checked List (...)

 

 
  一点点core java的笔记-集合

 

 

散列表: 桶,用链表数组实现

相关文章:

  • 2021-12-06
  • 2021-11-20
  • 2021-04-25
  • 2021-05-14
  • 2021-06-08
  • 2021-12-15
  • 2021-11-20
  • 2021-09-06
猜你喜欢
  • 2021-11-11
  • 2021-11-15
  • 2021-05-05
  • 2021-05-16
  • 2022-12-23
  • 2021-08-03
  • 2021-06-11
相关资源
相似解决方案