December 2001
Intermediate to advanced
416 pages
8h 16m
English
Our message() function of the preceding section is actually something of a problem. It represents the collection of values a user may wish to display. The problem is that the type and number of these values of interest to users are limitless. Trying to accommodate even a subset of all the requested variations soon begins to drive us crazy.
A more manageable solution is to declare a signature that can be passed an arbitrary number of arguments of possibly arbitrary types. We do this through the params variable-length parameter, which is characterized as follows:
The params keyword identifies that we are passing a variable number of parameters.
An array of the type of arguments we wish to accept follows the ...
Read now
Unlock full access