O'Reilly logo

C# 5.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

Summary

Figure 16.5 shows an overview of all nongeneric collection types. Also notice the implementation of interfaces like ICollection and IEnumerable.

Image

FIGURE 16.5 Nongeneric collection types (members filtered).

Note that that the combination of IEnumerable and ICollection is enough to enable the use of the C# 3.0 collection initializer language feature:

var lst = new ArrayList { 1, 2, 3 };

The preceding code is equivalent to the following:

ArrayList __t = new ArrayList();__t.Add(1);__t.Add(2);__t.Add(3);ArrayList lst = __t;

This illustrates how new language features can make old and existing application programming ...

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