Chapter 17. Inheritance

You will learn the following in this chapter:

  • What inheritance is and how you can use it to simplify programs

  • What base classes and derived classes are

  • What access specifiers are used with base and derived classes

  • How to use a combo box

  • What virtual classes are and how they can be used

Inheritance is a fundamental element of object-oriented programming (OOP) that promotes code reuse. Any time you can reuse a piece of code that has already been written, tested , and debugged , you enhance programmer productivity.

The basic idea behind inheritance is that although there may be unique properties that precisely define an object, many objects share common properties with other objects. For example, consider a building object. All buildings have certain properties in common. Each has a street address, a property tax rate and amount, a number of square feet, and so forth. However, specific types of buildings have additional properties that distinguish them from one another. Most building codes, for example, require commercial buildings to have a fixed number of parking spots per square foot of lease space. A private home, however, does not have that requirement. Likewise, a private home has properties, such as the number of bedrooms, that don't apply to a commercial building.

This chapter discusses how you can use inheritance to extend the functionality of a class.

Visual Basic .NET. Primer Plus
Visual Basic .NET Primer Plus
ISBN: 0672324857
EAN: 2147483647
Year: 2003
Pages: 238
Authors: Jack Purdum

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: