Alex Rivera | Logout

c# When should I use List and when should I use arraylist?

Asked 2009-04-07T12:31:20.253
47

As the title says when should I use List and when should I use ArrayList?

Thanks

Edit
Report

1 Answer

5

Since List is a generic class, I would tend to always use List.

ArrayList is a .NET 1.x class (still available & valid though), but it is not 'typed'/generic, so you'll need to cast items from 'object' back to the desired type; whereas when using List, you don't have to do that.

answered 2009-04-07T12:33:48.937

Your Answer