using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace Csharp_ArrayList
{
class Program
{
static void Main(string[] args)
{
ArrayList CountryList = new ArrayList();
CountryList.Add("Bangladesh");
CountryList.Add("India");
CountryList.Add("Pakistan");
CountryList.Add("Nepal");
CountryList.Add("Butan");
CountryList.Add("Srilanka");
CountryList.Add("Maldives");
Console.WriteLine("\n\n=====================\n");
foreach (object i in CountryList)
{
Console.WriteLine("\n {0}",i);
}
Console.WriteLine("\n\n==Array List Property");
Console.WriteLine("\n Capacity: {0} ", CountryList.Capacity);
Console.WriteLine("\n Count: {0}", CountryList.Count);
Console.WriteLine("\n is Fixed Size: {0} ", CountryList.IsFixedSize);
Console.WriteLine("\n Readonly: {0}", CountryList.IsReadOnly);
Console.WriteLine("\n IsSynchronized: {0} ", CountryList.IsSynchronized);
Console.WriteLine("\n\n==Array List Method==");
Console.WriteLine("\n\n==Array List Remove Method==");
ArrayList CityList = new ArrayList();
CityList.Add("Dhaka");
CityList.Add("Chittagong");
CityList.Add("Barisal");
CityList.Remove("Chittagong");
foreach (object i in CityList)
{
Console.WriteLine("\n {0}", i);
}
ArrayList StudentList = new ArrayList();
StudentList.Add("Monir");
StudentList.Add("Iqbal");
StudentList.Add("Zabed");
StudentList.Add("Anisur Rahman");
StudentList.RemoveAt(1);
Console.WriteLine("\n\n==Array List Sort and Remove Method==");
StudentList.Sort();
foreach (object i in StudentList)
{
Console.WriteLine("\n {0}", i);
}
Console.ReadKey();
}
}
}