Inheritance Basics Interfaces contain declarations only. Classes can contain both declarations and definitions. Classes can implement interfaces as well as inherit from a single parent class. Interfaces use the keyword Interface, and classes use the keyword Class in Visual Basic .NET. The difference between an interface and a class is that classes provide implementations for their members and interfaces define members without implementations. Both classes and interfaces support inheritance. A class may inherit from a single parent and implement zero or more interfaces, and interfaces support multiple interface inheritance but provide no implementation. (We will return to interfaces later in this chapter. For now let's focus on what classes offer.) Even if your understanding of inheritance is expert, you are encouraged to read the remainder of this section simply to see the grammar used to support class inheritance in Visual Basic .NET. |
Team-Fly |
Top |