Тёмный

Difference between Hashtable and dictionary  

Interview Preparation
Подписаться 6 тыс.
Просмотров 756
50% 1

Difference between Hashtable and Dictionary in c# #hashtable #dictionary #csharp #csharpinterviewquestions
Difference 1: Generics
Dictionary is a generic collection, which means that it can only store elements of a specific type,
whereas HashTable can store elements of any type.
Difference 2: Type Conversion
In a HashTable, the key and value types are both objects, so when you access a value by its key, you need to cast it to the appropriate type before you can use it.
In a Dictionary, the key and value types are strongly typed, so you don't need to cast the value when you access it.
Difference 3: Null Values
A Dictionary can accept null as a valid key or value, whereas a HashTable cannot store null as a key or a value.

Опубликовано:

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 2   
Далее
14.11 HashMap and HashTable in Java
8:44
Просмотров 684 тыс.
Double the Performance of your Dictionary in C#
15:12
Collections in C# .NET
6:03
Просмотров 40 тыс.