"Göran Andersson" <gu***@guffa.comwrote in message
news:eO**************@TK2MSFTNGP04.phx.gbl...
>I think List< object should be better, because it uses generics; so
it is type safer than ArrayList (in which you can put everything
derived from base object class).
No, there is no difference in type safety. A reference to an object is not
more type safe just because you use generics.
I think what he means is that an ArrayList can store multiple types, and
there's no checking to ensure that every element of the array is the same
type as every other element.
Perhaps a more significant benefit would be "type convenient". :)
As you note, C# is type safe no matter how you store a reference. But one
nice thing about the generic types is that because the type is explicitly
stated with the collection, you don't need to cast things as they are
referenced from the collection.
Pete