Ask Question

Perform the Insert, Modify and Remove functionalities on the Dictionary based on the Key.

+5
Answers (1)
  1. 26 October, 11:22
    0
    Dictionary contains Key value pairs where key is used to retrieve the value

    Explanation:

    Using System. Collections;

    void main () {

    Dictionary dict = new Dictionary ();

    dict. Add (1,"One");

    dict. Add (2,"Two");

    dict. Add (3,"Three");

    dict. Remove (1);

    dict[2] = "Two Updated";

    }

    Dictionary is a dictionary whose keys are integers and values are strings.

    Add function is used to add elements to the dictionary

    Remove function removes the key value pair from the dictionary based on given key.

    we can directly modify/update the element in dictionary using the key
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Perform the Insert, Modify and Remove functionalities on the Dictionary based on the Key. ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers