次の方法で共有


How Visual Basic Provides Polymorphism 

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

Other Resources

Designing an Inheritance Hierarchy