tags:

views:

38

answers:

3

As the title says. From what I can see online the Overloads keyword is optional but is there ever a time when it is necessary? It even seems to be an error when used in a Module.

+2  A: 

No, it's not neccessary. You can overload methods and properties without the Overloads keyword.

However, if you use the keyword on one overload of a method, you have to use it on all overloads to that method in the class.

You can use the Overloads keyword instead of the Shadows keyword to shadow an inherited method with the same signature. Then you have to use either of the keywords, they are not both optional.

Guffa
A: 

you don’t have to use the Overloads keyword to specify an overloaded method while within the same class. This is how C# handles overloading – there is no Overloads keyword in C#.
But using the Overloads keyword, tends to be more readable.
Check out this blog post for more detailed information.

Kamyar
+2  A: 

There is only one case where the keyword Overloads is mandatory. If a method has the keyword Overloads then any new method of the same name within the type must also have Overloads

Other than that case, the keyword is optional.

JaredPar