List Info

Thread: Ho to pass optional parameter in c#




Ho to pass optional parameter in c#
user name
2006-07-18 19:43:20

you can use param type, which could take zero parameters or more

Rob <rob64464yahoo.co.uk> wrote:

Hiya,
This would be an example:
public void SayHello(String name)
{
 &nbsp; &nbsp; &nbsp; &nbsp;   ; MessageBox.Show(name);
}
public void SayHello(String name, String name2)
{
 &nbsp; &nbsp; &nbsp; &nbsp;   ; MessageBox.Show(name+”\n”+name2);
}
public void SayHello(String name, String name2, String name3)
{
 &nbsp; &nbsp; &nbsp; &nbsp;   ; MessageBox.Show(name+\n”+name2+”\n”+;name3);
}
Notice I use the same method name and just add extra paramete rs. This is referred to as overloading in the C# language.
Kind Regards,
Robert A Heeley
0770 4121168
The contents of this message, including any attachments, are confidential and are intended solely for the use of the person or entity to whom the message was addressed. If you are not the intended recipient of this message, please be advised that any dissemination, distribution, or use of the contents of this message is strictly prohibited. If you received this message in error, please notify the sender. Please also permanently delete all copies of the original message and any attached documentation. Thank you.

From: Microsofts_C_Sharp@yahoogroups.com [mailto:Microsofts_C_Sharp@yahoogroups.com] On Behalf Of geme_ 3030
Sent: 18 July 2006 12:23
To: Microsofts_C_Sharp@yahoogroups.com
Subject: Re: [Microsofts_C_Sharp] Ho to pass optional parameter in c#
Expalin Plz  >>&gt; Do u Mean OverLoad Function ??

rkmnm <rkmnmyahoo.com&gt; wrote:
HI

can any one tell me how to pass optional Parameter in c#.

Plz Help me how to pass it.

Thanks

Ravi Mittal
 __________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com



Mohamed Meshref
Software Design Engineer
SQL Server&nbsp;Manageability Platform&nbsp;Team
Microsoft Corporation, Redmond HQ
Building 35, Office # 2201
Phone: +1-(425)704-8684
Mobile: +1-(425)445-7386
Email: microsoft.com">mmeshrefmicrosoft.com
Blog: http://www.mmeshref.com


Groups are talking. We’re listening. Check out the handy changes to Yahoo! Groups.

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )