OPtional Parameters

C# supports using optional parameters. They allow missing parameters when invoking the method. Their declaring is done by providing default value in the description of the parameter.

The following example illustrates using optional parameters:

The shown method PrintNumbers can be invoked in one of several ways:

results matching ""

    No results matching ""