Dictionary (TKey, TValue) Collection Example

Here I’ll be explaining some basic usage of the dictionary collection class. Dictionaries are a generic data type that stores values with an associated key. This key is important because it is used for lookup, addition, removing, and indexing of values. The dictionary is intended to be used with any data type as I’ll demonstrate below. What I’ll be doing is creating an object type and storing the type in a dictionary with a key. Then I will perform various tasks on the dictionary like displaying the elements, searching for elements, and removing elements. Continue reading

Advertisements