C# Programming - Collection Classes - Discussion

Discussion :: Collection Classes - General Questions (Q.No.5)

5. 

In a HashTable Key cannot be null, but Value can be.

[A]. True
[B]. False

Answer: Option A

Explanation:

No answer description available for this question.

Mukesh said: (Jul 11, 2012)  
Key cannot be null in Hash table. Because it is primary key.

A key cannot be null, but a value can be. To distinguish between null that is returned because the specified key is not found and null that is returned because the value of the specified key is null, use the Contains method or the Contains Key method to determine if the key exists in the list.

Lavanya said: (Jan 16, 2017)  
HashTable works on Key Value Pair. Hence, Key value cannot be NULL.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.