Chapter 5. Class Inheritance


Inheritance is one of the core concepts in object-oriented programming and in the .NET framework. Inheritance is the idea that a developer can create a class to serve as a building block for other classes. When a class inherits from another class it gains all the methods from the class it inherited from. The class the author inherits from is referred to as the base class. The class that inherits from the base is referred to as the derived class or the child class.

In this chapter you will learn how to inherit from another class and what happens when both the base and the derived class have a method with the same name .

Another feature related to inheritance that is crucial in object-oriented programming is polymorphism. With polymorphism, a variable of a base type can point to two different derived types. Each derived type may have a slightly different implementation for a method. In this chapter you will learn one way to achieve polymorphism by using virtual functions.



C#
C# & VB.NET Conversion Pocket Reference
ISBN: 0596003196
EAN: 2147483647
Year: 2003
Pages: 198
Authors: Jose Mojica

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net