Loading...
「ツール」は右上に移動しました。
利用したサーバー: natural-voltaic-titanium
30いいね 3568回再生

Dictionary VS Hashtable c#

Hashtable:
------------------------------------------------------------
Is included in the System.Collections namespace.
Is a loosely typed (non-generic) collection, this means it stores key-value pairs of any data types.
Is thread safe.
Hashtable returns null if we try to find a key which does not exist.
Data retrieval is slower than dictionary because of boxing-unboxing.


Dictionary:
------------------------------------------------------------
Is included in the System.Collections.Generic namespace.
Is a generic collection. So it can store key-value pairs of specific data types.
It throws an exception if we try to find a key which does not exist.
Data retrieval is faster than Hashtable.

コメント