O'Reilly logo

ADO.NET Programming in Visual Basic™ .NET by Bob Howell, Steve Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Polymorphism

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

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required