June 2006
Intermediate to advanced
1344 pages
42h 52m
English
Generic methods can be overloaded. A class can provide two or more generic methods with the same name but different method parameters. For example, we could provide a second version of generic method PrintArray (Fig. 25.3) with the additional parameters lowIndex and highIndex that specify the portion of the array to output. A generic method can also be overloaded by another generic method with the same method name and a different number of type parameters, or by a generic method with different numbers of type parameters and method parameters.
A generic method can be overloaded by non-generic methods that have the same method name and number of parameters. When the compiler encounters a method call, it searches ...
Read now
Unlock full access