Constructor with Int32 parameter in ArrayList
In this article I will explain the ArrayList Constructor (Int32).
Introduction
The ArrayList Constructor (Int32) initializes a new instance of the ArrayList class that is empty and has the specified initial capacity.
Example
namespace ConsoleApplication6
{
class Program
{
static void Main(string[] args)
{
// Creates a new ArrayList.
ArrayList days = new ArrayList(5);
days.Add("Sunday");
days.Add("Monday");
days.Add("Tuesday");
days.Add("Wednesday");
foreach (string s in days)
{
Console.WriteLine(s);
}
}
}
}
|
Output
Ask Your Question
Got a programming related question? You may want to post your question here