Should I use an ArrayList or IList

arraylist, c#, ilist

Solution

Inherit `CollectionBase` instead; this wraps `IList` and allows you to provide your own implementation of typed methods you need. This is what it's designed for :)

Problem

Im using the .NET framework 1.1 and Im hoping someone could help me implement a dynamic array of objects? A watered-down example of the object I wish use is below. ``` Class CarObj { public string CarName; public string CarYear; } ``` Should I use an ArrayList or do you think it would be better to make a CarList class to implement an IList interface? Is there a performance benefit for one over another?

Original source