Join Gerry O'Brien for an in-depth discussion in this video Using generics, part of Up and Running with C#.
In version 2.0 of C#, Microsoft introduced something known as Generics.…Generics are a concept for allowing you to define type safe classes without…committing to actual data types at the time that you define the class itself.…The Generics help you to maximize code…reuse, type safety, and performance of your application.…As an example, in previous types of…collections that were non-generic you could store…objects or different data types within some…of the collections in the .NET framework.…
And then to use those objects from that…collection again, potentially meant that you had to…deal with boxing and unboxing, which references really…the casting of an object to a specific type.…That exacts a performance penalty on your application.…Instead what we can do with generics is we can defer the type that we're…going to use with that class or with the collection until we actually use it.…And so we can create general purpose…collections, using generics that perform much better…than the non-generic type collections, and we'll…
- Installing C#
- Working with loops
- Controlling program flow
- Using variables
- Building functions
- Creating and instantiating classes
- Catching errors
- Managing resources with the garbage collector
- Building collections
Skill Level Beginner
1. Introducing C#
2. C# Language Elements
3. Object-Oriented Programming in C#
4. Structured Exception Handling
5. Resource Management in C#
6. Extensible Types in C#
7. Windows Apps in C#
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.