Skip to Content
Visual Basic 2015 Unleashed
book

Visual Basic 2015 Unleashed

by Alessandro Del Sole
July 2015
Intermediate to advanced
1300 pages
87h 27m
English
Sams
Content preview from Visual Basic 2015 Unleashed

Creating and Consuming Generics

You can define the following types as generics: classes, interfaces, delegates, structures, and methods. Creating a generic type is accomplished by providing a parameterized type definition. The following is an example:

Class CustomType(Of T)End Class

The Of keyword is followed by the type that the new object can handle. T is the type parameter and represents the .NET type you want to be held by your generic type. The type parameter’s name is left to your own choosing, but T is often used as a common name in the .NET Framework Base Class Library (BCL). At this point, you must write code to manipulate the T type in a way that will be convenient for possibly every .NET type. Now imagine you want to build a custom ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Visual Basic 2015

Beginning Visual Basic 2015

Bryan Newsome

Publisher Resources

ISBN: 9780134196664Purchase book