Chapter 7. Generics

The definition of generic, as found in Merriam-Webster’s Collegiate Dictionary, is "of a whole genus, kind, class, etc.; general; inclusive." Based on this definition, a person is generic, whereas Donis Marshall is quite specific. City is generic, whereas Seattle is specific. More specific to programming, a data algorithm is generic, whereas the implementation is specific. A stack is generic, whereas a stack of integers is specific. A spreadsheet is generic, whereas a spreadsheet of strings is specific.

In the Microsoft .NET Framework, an implementation of a class or structure is specific. A StackInt class is a specific type and a specialization of the stack pattern, which targets integers. A stack of strings or floats would ...

Get Programming Microsoft® Visual C#® 2008: The Language 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.