C# Generics Recipes
| Visual C# Tutorials |
| C# Tutorials |
|
C# Generics Recipes |
| © 2006 O'Reilly Media, Inc. |
| This tutorial—CSharp Generics Recipes—is from C# Cookbook, 2nd edition, by Jay Hilyard, Stephen Teilhet. Copyright © 2006 O'Reilly Media, Inc. All rights reserved. This article is reproduced by permission. This tutorial has been edited especially for C# Online.NET. Read the book review! |
|
C# Generics Recipes
4.0 Introduction
A long-awaited feature, generics, is finally here with the advent of Version 2.0 of the
C# compiler. Generics is an extremely useful feature that allows you to write less,
but more efficient, code. This aspect of generics is detailed more in Recipe 4.1. With generics comes quite a bit of programming power, but with that power comes the
responsibility to use it correctly. If you are considering converting your ArrayList,
Queue, Stack, and Hashtable objects to use their generic counterparts, consider reading
Recipes 4.4, 4.5, and 4.10. As you will read, the conversion is not always simple
and easy, and there are reasons why you might not want to do this conversion at all.
Other recipes in this chapter deal with other generic classes contained in the .NET Version 2.0 Framework, such as Recipe 4.6. Still others deal with the operation of any generic type, such as Recipes 4.2, 4.8, and 4.13.
|


