ArrayList क्लास में Count गुण ArrayList में एलिमेंट्स की संख्या गिनता है।
सबसे पहले ArrayList में एलिमेंट्स जोड़ें:
ArrayList arrList = new ArrayList(); arrList.Add(98); arrList.Add(55); arrList.Add(65); arrList.Add(34);
फिर ऐरे लिस्ट की संख्या प्राप्त करें:
arrList.Count
निम्न C# में Count गुण को कार्यान्वित करने का कोड है:
उदाहरण
using System; using System.Collections; class Demo { public static void Main() { ArrayList arrList = new ArrayList(); arrList.Add(98); arrList.Add(55); arrList.Add(65); arrList.Add(34); Console.WriteLine("Count = " + arrList.Count); } }आउटपुट
Count = 4