O'Reilly logo

Visual Basic® .NET by Example by Bob Donald, Gabriel Oancea

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

What Is Inheritance?

Let's assume you need to model and program a Human Resources (HR) system, which deals with the employees of the company and customer contacts, among other entities. The approach based on what you know today (and what you would do in a previous version of Visual Basic) would be to design two classes: one for employees and one for customer contacts. They would look like the UML diagram in Figure 17.1 and be implemented as shown in the code that follows.

Figure 17.1. Class diagram for the Employee and Customer classes.

The implementation for the Employee class would be:

 Public Class Employee Private m_name As String Private m_dob ...

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