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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Doubt 5
doubt 1
clarification is needed 4
Doubt 4
Doubt in C-Sharp 1
Doubt 2
Doubt 3
doubt in csharp 5

Back
Top