July 2015
Intermediate to advanced
1300 pages
87h 27m
English
The System.Collections.Generic.Dictionary(Of TKey, TValue) collection is the generic counterpart for the HashTable. Each item within a Dictionary is a key/value pair; therefore, the constructor requires two arguments (TKey and TValue) where the first one is the key and the second one is the value. The following code shows instantiating a Dictionary(Of String, Integer) in which the String argument contains a person’s name and the Integer argument contains the person’s age:
Dim peopleDictionary As New Dictionary(Of String, Integer)peopleDictionary.Add("Alessandro", 37)peopleDictionary.Add("Stephen", 27)peopleDictionary.Add("Rod", 44)
A single item in the collection is of type ...
Read now
Unlock full access