Lecture overview -- Keyboard shortcut: 'u'  Previous page: Generic Methods [Section] -- Keyboard shortcut: 'p'  Next page: Generic Delegates -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Alphabetic index  Help page about these notes  Course home    Generic Types and Methods - slide 18 : 21

Generic Methods

A generic method is a template of a method that takes a number of type parameters

It is possible to have generic methods in both generic and non-generic types

app-1.cs
The generic method ReportCompare in the generic String programs.
app-3.cs
An equivalent program without automatic inference of the actual type parameters.
sort-appl.cs
A generic bubble sort program.
output
Output from the generic bubble sort program.