微软在.Net FrameWork 2.0中,引入了范型,相比.Net FrameWork 1.1中的三个集合类。

范型具有类型安全、无需GC的优点,对值类型无需进行性能损失很大的装箱与拆箱操作。

主要看 System.Collections.Generic 命名空间,略作总结:

ArrayList --> List<T>
Hashtable --> Dictionary<TKey, TValue>
SortedList --> SortedDictionary<TKey, TValue>
Stack --> Stack<T>
Queue --> Queue<T>
LinkedList<T> 无对应类

 

相关文章:

  • 2021-09-25
  • 2021-07-02
  • 2021-12-06
  • 2021-06-20
猜你喜欢
  • 2021-10-25
  • 2021-05-16
  • 2021-07-24
  • 2021-06-01
  • 2022-01-18
  • 2021-07-02
相关资源
相似解决方案