Understanding Generics (en.csharp-online.net)
submitted by
Hyle(2755) 5 years, 5 months ago
Learn the usage and benefits of generics to define a class and method without specifying a particular type. Excerpt: With the release of .NET 2.0, the C# programming language has been enhanced to support a new feature of the CTS termed generics. Simply put, generics provide a way for programmers to define “placeholders” (formally termed type parameters) for method arguments and type definitions, which are specified at the time of invoking the generic method or creating the generic type. To illustrate this new language feature, this chapter begins with an examination of the System.Collections.Generic namespace. Once you’ve seen generic support within the base class libraries, in the remainder of this chapter you’ll examine how you can build your own generic members, classes, structures, interfaces, and delegates.
|category: C#
|Views: 14
tags:
Generics C# another
Everyones tags:
Your Tags: