using System.Collections.Generic; Listnumbers = new List (); numbers.Add(1); numbers.Add(2); numbers.Add(3);
using System.Collections.Generic; Dictionaryscores = new Dictionary (); scores.Add("John", 10); scores.Add("Jane", 20); scores.Add("Bob", 15); if (scores.ContainsKey("John")) { Console.WriteLine(scores["John"]); }
using System.Collections.Generic; QueueIn conclusion, the System.Collections.Generic namespace is a part of the .NET Framework in C# that provides a set of interfaces and classes for working with generic collections. It is the package library for this namespace.names = new Queue (); names.Enqueue("John"); names.Enqueue("Jane"); names.Enqueue("Bob"); while (names.Count > 0) { Console.WriteLine(names.Dequeue()); }