What is the purpose of ArrayList in .NET?ArrayList
is used to store elements of different data types.
Advantage of ArrayList is that its size can grow or shrink dynamically. Here is an example using an ArrayList to store and read list of integers and list of strings: public class
sampleClass { Output of this code will be: Elements
of integer list are: 10 20 ArrayList
has many methods like Clear(), AddRange(<list>), RemoveAt(<index>),
Insert(<position, element>) and properties like count. You can use
them to manipulate on ArrayList elements.
|