Array list is a type which similar to an Array. We will specify the size for
the Array which will never going to change in its life time. But In
Array List, the size gets dynamically increases when needed.
Example:
Using System.Collections;
Public static void main(String[] args)
{
ArrayList arrList = new ArrayList();
arrList.Add(11);
arrList.Add(12);
arrList.Add(13);
arrList.Add(14);
foreach(int num in arrList)
{
Console.WriteLine(num);
}
}
Asked In: Many Interviews |
Alert Moderator