Visual Studio Next Generation: Language Enhancements

Overloading

Overloading is a feature that will allow an object's methods and operators to have different meanings depending on its context. Operators can behave differently depending on the data type, or class, of the operands. For example, x+y can mean different things depending on whether x and y are integers or structures. Overloading is especially useful when your object model dictates that you employ similar names for procedures that operate on different data types. For example, a class that can display several different data types could have display procedures that look like this:

Overloads Sub Display (theChar As Char)
...
Overloads Sub Display (theInteger As Integer)
...
Overloads Sub Display (theDouble As Double)

Without overloading, you'd have to create distinct names for each procedure even though they do the same thing:

Sub DisplayChar (theChar As Char)
...
Sub DisplayInt (theInteger As Integer)
...
Sub DisplayDouble (theDouble As Double)

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“We better hurry up and start coding, there are going to be a lot of bugs to fix.”