Difference Between ArrayList and Generic.List C#/VB.Net
Hi, Last few Days, I learnt a very basic and important thing about that ,When one should go for ArrayList or Generic.List in coding......On basis of that, I found few difference between both. ArrayList Its comes under System.Collections namespace. Its contains Array of Object.i.e Any objects type we can store in a ArrayList.We can store any no. of objects at runtime. ArrayList aryList= new ArrayList(); // No Need to specify the object type,can store anything arList.Add(1); arList.Add("Shubhank"); arList.Add("False"); We can store any objects in ArrayList and can retrieve only Objects from ArrayList... We can say that ArrayList is not Type-Safe .At the Time of inserting recods ,we can store any type of objects,but at the time of fetching we can't be sure that Values which are populate by arList (ArrayList object ) of what type..however.. we have to following code while fetching records/items from Array list foreach(Object o in...