The parameters of a method, if any, are declared by the method's formal parameter list. The formal parameter list consists of zero or more formal parameters, separated by commas. If no type is specified, it is implicitly Object
. However, if one parameter includes an As
clause, all parameters must specify them.. A parameter which does not specify either ByRef
or ByVal
defaults to ByVal
.
Formal parameter names are scoped to the entire body of the method and are always publicly accessible. A method invocation creates a copy, specific to that invocation, of the formal parameters, and the argument list of the invocation assigns values or variable references to the newly created formal parameters.
,
FormalParameterAs
TypeName ] [ = ConstantExpression ]ByRef
| ByVal
| Optional
| ParamArray