Lecture overview -- Keyboard shortcut: 'u'  Previous page: Constraints on Formal Type Parameters -- Keyboard shortcut: 'p'  Next page: Another example of constraints -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 10 : 21
Object-oriented Programming in C#
Generic Types and Methods
Constraints: Strings of comparable elements

String<T> generalizes string of char to string of comparable elements

 

/user/normark/oop-csharp-1/sources/c-sharp/generics/string/string.csThe generic class String<T>.


/user/normark/oop-csharp-1/sources/c-sharp/generics/string/app-1.csIllustrating a number of String<int> objects. This program is explained


/user/normark/oop-csharp-1/sources/c-sharp/generics/string/app-1-outputOutput from the String<int> program.


/user/normark/oop-csharp-1/sources/c-sharp/generics/string/app-2.csIllustrating Strings of different types.


/user/normark/oop-csharp-1/sources/c-sharp/generics/string/app-2-outputOutput from the String of different types program.


Go to exerciseComparable Pairs