Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Traditionally, polymorphism in Visual Basic was accomplished with interfaces, and interfaces can still be used for this purpose. Now, however, Visual Basic provides the option of using inheritance to provide polymorphism as well.
As with other issues in object-oriented programming, the option to use depends on your specific requirements. In general, use inheritance when you want to create baseline functionality that derived classes can extend; use interfaces in situations where similar functionality needs to be provided by multiple implementations that have little in common.
See Also
Concepts
Inheritance-Based Polymorphism
Interface-Based Polymorphism