Arraylist:
- Variable length
- Insert, Update,Delete data anywhere in the list
- Type independent
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Collections; //Use for all non-generic collections.....
- namespace arrayList
- {
- class Program
- {
- static void Main(string[] args)
- {
- ArrayList arralist = new ArrayList();
- arralist.Add(101);
- arralist.Add("Hasan Sujan");
- arralist.Add("CSE");
- arralist.Add("01754704559");
- print(arralist);
- arralist.Insert(2,21);
- print(arralist);
- Console.ReadKey();
- }
- public static void print(ArrayList arralist)
- {
- foreach (var i in arralist)
- {
- Console.WriteLine(i);
- }
- }
- }
- }
0 Comments:
Post a Comment