Count Property in ArrayList
In this article I will explain the count property of ArrayList.
We can get the number of elements that actually contained in the ArrayList.
namespace ArrayList1
{
class Program
{
static void Main(string[] args)
{
ArrayList ar = new ArrayList();
ar.Add("Jan");
ar.Add("Feb");
ar.Add("March");
ar.Add("April");
ar.Add("May");
ar.Add("June");
ar.Add("July");
int a = ar.Count;
Console.WriteLine("The number of elements in the ArrayList are:" + a);
}
}
}
|
You may also want to read these related articles.
Ask Your Question
Got a programming related question? You may want to post your question here