A HashTable is used to store the collection of different types of data in key-value pairs. These table data are organized based on the hash key. A HashTable is provided by the System.Collection namespace. A Key is used to identify and access each element of the HashTable because each item in the HashTable has a Key/value pair.
The following table describes the properties of the HashTable
||It is used to obtain a value that determines whether the HashTable is synchronized.
||It is used to obtain a value that determines whether a HashTable has a fixed size.
||It is used to count the number of key/value pair elements available in the HashTable.
||It is used to obtain a value that determines whether the HashTable is read-only.
||It is used to get or set a value associated with the specified key.
||It is used to obtain a collection of keys in a HashTable.
||It is used to obtain a collection of values in a HashTable.
The Following are the commonly used method of the HashTable in the VB.NET.
||It is used to add an element with the specified key and value into the HashTable.
Syntax: HashTable.Add(key, value)
||It is used to check whether the specified key exists or not in HashTable.
||It is used to check whether the specified value of the key is existing or not in HashTable.
||The Remove function is used to remove the specified key with the corresponding value.
||It is used to remove all the elements from the HashTable.
||A GetHash is used to get the hash code of the specified key in HashTable/
Let's create a program to understand the concept of HashTable in the VB.NET programming language.