answersLogoWhite

0

In object-oriented programming (OOP), programmers can create virtual copies of objects from schematics called classes. Classes contain variables of data and methods that can perform tasks with the object or other objects. For a real-world example, a class called "cook" might have variables containing various cooking times and methods for chopping vegetables. Methods can accept data input and provide data output. When a method is programmed to accept different types of data for different occasions, this is called "overloading" a method.

Overloading provides an easy way for methods to keep the same name but allow for different inputs. At compiling time, the application evaluates the input data and chooses which overloaded method to use. By overloading methods, a programmer can also keep a single name for a method despite type differences, which cleans up the code.

How to Overload a Method

Overloading a method in visual basic requires the addition of the keyword "Overloads" into the method definition. The keyword is placed in between the visibility call (i.e. public or private) and the function call (e.g. Public Overloads Function). Each different function definition must have the same name and a different number or type of input variable.

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

RafaRafa
There's no fun in playing it safe. Why not try something a little unhinged?
Chat with Rafa
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine

Add your answer:

Earn +20 pts
Q: What is method overloading in vb net?
Write your answer...
Submit
Still have questions?
magnify glass
imp