C# Programming - Collection Classes - Discussion
Discussion Forum : Collection Classes - General Questions (Q.No. 5)
5.
In a HashTable Key cannot be null, but Value can be.
Discussion:
2 comments Page 1 of 1.
Lavanya said:
8 years ago
HashTable works on Key Value Pair. Hence, Key value cannot be NULL.
Mukesh said:
1 decade ago
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.
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.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers