June 2006
Intermediate to advanced
1344 pages
42h 52m
English
Methods can have optional parameters. Declaring a parameter as optional allows the calling method to vary the number of arguments to pass. Optional parameters specify a default value that is assigned to the parameter if the optional argument is not passed. Overloaded methods are generally more flexible than methods with optional parameters. For instance, you can specify different return types for overloaded methods.
You can create methods with one or more optional parameters. All optional parameters, however, must be placed to the right of the method’s non-optional parameters.
Common Programming Error 7.10
|
| Declaring a ... |
Read now
Unlock full access