December 2002
Beginner to intermediate
432 pages
10h 10m
English
Polymorphism is the ability of a class to take on different functionality based on the context in which it is used. Polymorphism is chiefly implemented in most OOP languages using techniques called method overloading, overriding, and shadowing.
Overloading is how we can create methods that have the same name but accept many different argument parameters. We can overload methods we create and we can overload methods we override. Suppose we want to create a function that, if passed numbers, adds the two numbers and returns the result, but if passed strings, concatenates the strings and returns the result.
Public Function Add(ByVal intA As Integer, _ ByVal intB As Integer) as Object Dim intC As Integer intC = intA + intB ...
Read now
Unlock full access