Data Access, Properties, and Methods
- slide 25 : 29
Output Parameters
Output parameters are used for output from methods. The method is supposed to assign values to output parameters.
Output parameter passing
The corresponding argument must be a variable
The corresponding argument needs not to have a value on beforehand
The formal parameter should/must be assigned by the method
The formal parameter becomes another name (an alias) of the argument
The types of the formal parameter and the argument must be identical
The actual parameter must be prefixed with the keyword
out
The class A with a DoAdd method.
Output of class A with DoAdd.