What is the Count property of SortedList class in C#?



Example

 Live Demo

using System; using System.Collections; namespace Demo {    class Program {       static void Main(string[] args) {          SortedList s = new SortedList();          s.Add("S1", "Electronics");          s.Add("S2", "Clothing");          s.Add("S3", "Applicances");          s.Add("S4", "Books");          s.Add("S5", "Accessories");          s.Add("S6", "Musical Instruments");          Console.WriteLine("Count = " + s.Count);       }    } }

Output

Count = 6
Updated on: 2020-06-20T11:02:51+05:30

135 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements