Optional parameters in C#


Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

Optional parameters

C# supports optional parameters when working with methods. Optional are parameters that have default value specified like shown in the following example. It is convenient way to write methods that have default values specified for their arguments.

Optional parameters must be the last ones in method arguments list.

Open Source Your Knowledge: become a Contributor and help others learn. Create New Content