摘自api:

1、ArrayList与Vector:

原文:This class(ArrayList) is roughly equivalent to Vector, except that it is unsynchronized.

ArrayList是不同步的,Vector是同步的,在多线程环境中Vector更安全。如果在程序程序中不需要考虑线程安全,推荐使用ArrayList来代替Vector。

 

2、HashMap与HashTable:

原文:The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls.

HashMap可以除了不是同步的,并且允许null值来作为键值和元素值外,可以大致看做HashTable。HashTable不允许使用null值来作为键值和元素值。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-03-07
  • 2021-04-06
  • 2022-12-23
  • 2021-07-25
  • 2021-06-12
猜你喜欢
  • 2022-12-23
  • 2021-12-24
  • 2021-07-04
  • 2021-07-16
  • 2021-07-22
  • 2022-02-09
相关资源
相似解决方案