C# | Get an ICollection containing the values in ListDictionary Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report ListDictionary.Values property is used to get an ICollection containing the values in the ListDictionary. Syntax: public System.Collections.ICollection Values { get; } Return Value : It returns an ICollection containing the values in the ListDictionary. Below are the programs to illustrate the use of ListDictionary.Values property: Example 1: CSHARP // C# code to get an ICollection // containing the values in the ListDictionary using System; using System.Collections; using System.Collections.Specialized; class GFG { // Driver code public static void Main() { // Creating a ListDictionary named myDict ListDictionary myDict = new ListDictionary(); myDict.Add("Australia", "Canberra"); myDict.Add("Belgium", "Brussels"); myDict.Add("Netherlands", "Amsterdam"); myDict.Add("China", "Beijing"); myDict.Add("Russia", "Moscow"); myDict.Add("India", "New Delhi"); // Get an ICollection containing // the values in the ListDictionary ICollection ic = myDict.Values; // Displaying the values in ICollection ic foreach(String str in ic) { Console.WriteLine(str); } } } Output: Canberra Brussels Amsterdam Beijing Moscow New Delhi Example 2 : CSHARP // C# code to get an ICollection // containing the values in the ListDictionary using System; using System.Collections; using System.Collections.Specialized; class GFG { // Driver code public static void Main() { // Creating a ListDictionary named myDict ListDictionary myDict = new ListDictionary(); myDict.Add("I", "first"); myDict.Add("II", "second"); myDict.Add("III", "third"); myDict.Add("IV", "fourth"); myDict.Add("V", "fifth"); // Get an ICollection containing // the values in the ListDictionary ICollection ic = myDict.Values; // Displaying the values in ICollection ic foreach(String str in ic) { Console.WriteLine(str); } } } Output: first second third fourth fifth Note: The order of the values in the ICollection is unspecified, but it is the same order as the associated keys in the ICollection returned by the Keys method. The returned ICollection is not a static copy. Instead, the ICollection refers back to the values in the original ListDictionary. Therefore, changes to the ListDictionary continue to be reflected in the ICollection. Retrieving the value of this property is an O(1) operation. Reference: https://learn.microsoft.com/en-us/dotnet/api/system.collections.specialized.listdictionary.values?view=netframework-4.7.2 Comment More infoAdvertise with us Next Article Must Do Coding Questions - Topic-wise S Sahil_Bansall Follow Improve Article Tags : C# CSharp-Specialized-Namespace CSharp-Specialized-ListDictionary Similar Reads Interview PreparationInterview Preparation For Software DevelopersMust Coding Questions - Company-wise Must Do Coding Questions - Topic-wiseCompany-wise Practice ProblemsCompany PreparationCompetitive ProgrammingSoftware Design-PatternsCompany-wise Interview ExperienceExperienced - Interview ExperiencesInternship - Interview ExperiencesPractice @GeeksforgeeksProblem of the DayTopic-wise PracticeDifficulty Level - SchoolDifficulty Level - BasicDifficulty Level - EasyDifficulty Level - MediumDifficulty Level - HardLeaderboard !!Explore More...Data StructuresArraysLinked ListStackQueueBinary TreeBinary Search TreeHeapHashingGraphAdvance Data StructuresMatrixStringAll Data StructuresAlgorithmsAnalysis of AlgorithmsSearching AlgorithmsSorting AlgorithmsPattern SearchingGeometric AlgorithmsMathematical AlgorithmsRandomized AlgorithmsGreedy AlgorithmsDynamic ProgrammingDivide & ConquerBacktrackingBranch & BoundAll AlgorithmsProgramming LanguagesCC++JavaPythonC#Go LangSQLPHPScalaPerlKotlinWeb TechnologiesHTMLCSSJavaScriptBootstrapTailwind CSSAngularJSReactJSjQueryNodeJSPHPWeb DesignWeb BrowserFile FormatsComputer Science SubjectsOperating SystemsDBMSComputer NetworkComputer Organization & ArchitectureTOCCompiler DesignDigital Elec. & Logic DesignSoftware EngineeringEngineering MathematicsData Science & MLComplete Data Science CourseData Science TutorialMachine Learning TutorialDeep Learning TutorialNLP TutorialMachine Learning ProjectsData Analysis TutorialTutorial LibraryPython TutorialDjango TutorialPandas TutorialKivy TutorialTkinter TutorialOpenCV TutorialSelenium TutorialGATE CSGATE CS NotesGate CornerPrevious Year GATE PapersLast Minute Notes (LMNs)Important Topic For GATE CSGATE CoursePrevious Year Paper: CS exams Like