O'Reilly logo

Visual Basic .NET Programming Language, The by Paul Vick

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

Chapter 13. Inheritance

Often, types in a program share the same characteristics. For example, a program may contain types that represent a customer and an employee.

Class Customer
  Public Name As String
  Public Address As String
  Public City As String
  Public State As String
  Public ZIP As String

  Public CustomerID As Integer
End Class

Class Employee
  Public Name As String
  Public Address As String
  Public City As String
  Public State As String
  Public ZIP As String

  Public Salary As Integer
End Class

In this situation, both the Customer and Employee classes contain a number of identical fields. This is because the two classes each describe a person, and a person has certain characteristics, such as a name and address, that exist independent of whether or ...

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