471,336 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,336 software developers and data experts.

vb equivalent

hey all,
in vb you have overloads
Public Overloads Sub

how would you say that in csharp?

thanks,
rodchar
Jun 27 '08 #1
3 1101
You don't need to say it in C#, you just make another method that has the
same name as an existing one but has a different signature.

int Foo()
{

}

int Foo(string)
{

}

-Scott
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:5A**********************************@microsof t.com...
hey all,
in vb you have overloads
Public Overloads Sub

how would you say that in csharp?

thanks,
rodchar

Jun 27 '08 #2
what about the following:
public new void myfunction()

i don't think i've seen a "new" in a function declaration?

"Scott M." wrote:
You don't need to say it in C#, you just make another method that has the
same name as an existing one but has a different signature.

int Foo()
{

}

int Foo(string)
{

}

-Scott
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:5A**********************************@microsof t.com...
hey all,
in vb you have overloads
Public Overloads Sub

how would you say that in csharp?

thanks,
rodchar


Jun 27 '08 #3
On Fri, 25 Apr 2008 20:50:01 -0700, rodchar
<ro*****@discussions.microsoft.comwrote:
what about the following:
public new void myfunction()

i don't think i've seen a "new" in a function declaration?
What about it? Are you asking what that does? The "new" keyword allows
you to hide a method with the same signature in a base class. If I recall
correctly, the equivalent keyword in VB.NET is "Shadows".

Pete
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by John | last post: by
2 posts views Thread by Michael Foord | last post: by
6 posts views Thread by Frank Rachel | last post: by
7 posts views Thread by Tim Conner | last post: by
10 posts views Thread by karch | last post: by
9 posts views Thread by Alan Silver | last post: by
14 posts views Thread by grid | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.