July 2007
Intermediate to advanced
224 pages
4h 31m
English
It is simple to write our own generic classes. In our class declaration, we specify a parameter type name in angle brackets, as shown on the facing page. It is customary to use very short names for these, such as T and K, but I've gone with a longer one to remind you constantly of the type that name represents. In VB, the type parameter is declared using the Of operator. You then use that type name parameter to represent whatever type the user passes at instantiation time.
chuck: come back
Generics work only for parameters whose type is known at compile time. They do not automatically perform reflection to figure it out at runtime. They work very well, and are a big advantage, when dealing ...
Read now
Unlock full access