Parameter Qualifiers: in, out, const and immutable

This lesson first acquaints you with the term parameter qualifier and then explains in, out, const and immutable parameter qualifiers.

We'll cover the following

Parameter qualifiers #

Parameters are passed to functions according to the general rules described below:

  • Value types are copied, after which the original variable and the copy are independent.

  • Reference types are copied as well, but both the original reference and the parameter provide access to the same variable.

Those are the default rules that are applied when parameter definitions have no qualifiers. The following qualifiers change the way parameters are passed and what operations are allowed on them.

in #

We have seen that functions can produce values and can have side effects. The in keyword specifies that the parameter is going be used only as input:

Get hands-on with 1200+ tech skills courses.