Doubt

  • Thread starter Thread starter Baskar RajaSekharan
  • Start date Start date
B

Baskar RajaSekharan

Let Me know one thing whether the following is possible on C# or not.

Whehter Optional parameter's are allowed in C-Sharp or Not? I am talking
about trialing Default argument.

In MSDN There is one topic called default argument Values. It's not very
clear.

Note : without overloding a MEthod
Without using the Parm Key Word
Regards
R.Baskar
 
Baskar RajaSekharan said:
Let Me know one thing whether the following is possible on C# or not.

Whehter Optional parameter's are allowed in C-Sharp or Not? I am talking
about trialing Default argument.

In MSDN There is one topic called default argument Values. It's not very
clear.

Note : without overloding a MEthod
Without using the Parm Key Word


Hi Baskar,

C# doesn't have optional/default parameters. So, you will need to either
overload or use the param parameter type, as you indicate in your note.
Remember that when reading documentation and some articles, multiple
languages are being discussed. Since VB.NET does have optional parameters,
it is likely that this is what was being discussed and the context may not
have been clear.

Here's some good advice on optional parameters (Watch line wrap):

http://groups.google.com/groups?q=G...et.*&selm=u9BUPdKMBHA.1424@tkmsftngp03&rnum=2

Joe
 
Back
Top