4.13. Summary

All in all, you should come away from this chapter feeling like generic classes are not all that different their non-generic counterparts. Throughout this chapter, you have been exposed to each of the elements of a class and learned how generics are used to extend this model and make your classes more versatile, type-safe, and efficient. This included looking at constructors, inheritance, fields, methods, overloading, and all the constructs that are influenced by the introduction of generics. The chapter also looked at some of the rules that govern accessibility of generic classes. Finally, the chapter examined a series of other aspects of working with generic classes, including generic interfaces, generic structs, nullable generic types, and the default keyword. Equipped with this knowledge, you're likely to find plenty of new opportunities to leverage generic classes as part of your own solutions.

Get Professional .NET 2.0 Generics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.