Pergunta de entrevista da empresa AXIS Capital

when would you use generics and what are its advantages compared to ArrayList

Resposta da entrevista

Sigiloso

10 de set. de 2012

Generics are strongly typed, iteration is typesafe, no casting or test for type necessary. More LINQ extension methods apply to generic than non-generic collections. Can extract all elements of the same type from an ArrayList with ArrayList.OfType(), and then proceed working with the generic, strongly-typed List.