you can use param type, which could take zero parameters or more
Rob <rob64464
yahoo.co.uk> wrote: Hiya,
This would be an example:
public void SayHello(String name) {
MessageBox.Show(name);
}
public void SayHello(String name, String name2)
{
MessageBox.Show(name+”\n”+name2);
}
public void SayHello(String
name, String name2, String name3)
{
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 >>> Do u Mean OverLoad Function ??
rkmnm <rkmnm
yahoo.com> 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
Groups are talking. We’re listening. Check out the handy changes to Yahoo! Groups.
__._,_.___
.