Another new feature added to .Net 4.0 is to call methods using named parameters. This is very handy when calling a method which has optional arguments (You can use this to call other methods which consist of non optional parameters too). We’ll consider the following method.
And assume that we only need to pass a value only to the last parameter. If the named parameter method was not there, the way to call the method would be something like this:
But instead we can call the method using the following syntax.
And you will get the following output: