Consider the following two Drive methods closely:
Public Function Drive() As String If m_make = "Oldsmobile" then Return "Chicago" Else Return "Toledo" End If End Function
Public Function Drive(ByVal make As String) As String If make = "Oldsmobile" Then Return "Chicago" Else Return "Toledo" End If End Function
This is called Overloading the Method. We've overloaded it with two different ways of calling the function. We can either call it passing in no parameters, or call it passing in the make. Each method returns a string, but the parameters and how the method works internally can be different. In order to overload a method, the method signature must be different. "Method Signature" is just a technical term that means each one must have a different set of parameters. Why would you overload a method? When you create classes, you don't always know how they might be used up front in your application. Sometimes you don't have all the data readily available to you that you would need to call a method, so you need options on how to call the method.
Supplemental Readings for the Express Edition Videos Copyright © 2005 LearnVisualStudio.NET