Data Access, Properties, and Methods
- slide 24 : 29
Reference Parameters
Reference parameters can be used for both input to and output from methods
Reference parameter passing
The corresponding argument must be a variable, and it must have a value
The types of the formal parameter and the argument must be identical
The formal parameter becomes another name (an alias) of the argument
The actual parameter must be prefixed with the keyword
ref
The class A with a Swap method.
Output of class A with Swap.