May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Because constructors are effectively methods, they support the overloading feature. You can therefore provide multiple implementations of the New method, taking care of the limitations described for methods. You cannot use the Overloads keyword; the compiler does not need it. For example, continuing the example of the Contact class, we can provide different implementations of the constructor as follows:

The first overload receives no arguments and provides a default members’ initialization. The second overload receives just an argument, initializing other members with empty strings. The last overload is the most complete ...
Read now
Unlock full access