ArrayList वर्ग में गणना गुण ArrayList में तत्वों की संख्या की गणना करता है।
सबसे पहले, ArrayList में तत्व जोड़ें -
ArrayList arrList = new ArrayList(); arrList.Add(98); arrList.Add(55); arrList.Add(65); arrList.Add(34);
फिर सरणी सूची की गिनती प्राप्त करें -
arrList.Count
C# में काउंट प्रॉपर्टी को लागू करने के लिए कोड निम्नलिखित है -
उदाहरण
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