O'Reilly logo

C# 4.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

List<T>

The generic counterpart of the ArrayList type is the generic List<T> type, where the type parameter T stands for, unsurprisingly, the element type. Available methods on List<T> are pretty much the same as on ArrayList. We can even easily port our ArrayList example to List<int>:

image

Named Parameters?

image You might have noticed before in the examples of nongeneric collection types that I’ve been using named parameters sometimes. This isn’t necessary to make the preceding code compile but serves as a form of documentation for the meaning of used ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required