I knew that .NET 2.0 have template ArrayList
for example ArrayList<int> intArray;
However, due to system constraint, I use .NET 1.1 framework.
My question is how to implement a collection class which can work likes a ArrayList<int> intArray;
I have had it with "Type casting" of ArrayList. ><
Thanks.

How to write a ArrayList-like collection type which can be used by specified data type.
Luislcm
public class IntList : IList
It should say to press Tab to generate methods for IList. Do that. Then add a private field of type ArrayList (I'll call it list), and then go through all of the generated methods and replace "object" with "int". Inside the methods, just call the methods of list and cast as necessary.
Here's two of the methods:
public bool IsReadOnly
{
get
{
return list.IsReadOnly;
}
}
public int Add(int value)
{
return list.Add(value);
}
After you do that, you have to go and delete the IList, ICollection, IEnumerable part from the top of the class -- you no longer implement them since you switched object to int, they were just to help you know what methods you need. You may also want to make the class implement ICloneable, like ArrayList does.
Of course, this is your own class, so if you don't think you'll ever need to call a certain method, feel free to delete it.