Changes

Jump to: navigation, search

C Sharp Inheritance

3 bytes removed, 16:10, 22 January 2008
What is Inheritance?
The concept of inheritance brings something of a real-world view to programming. It allows a class to be defined which has a number of characteristics and then other classes to be created which are derived from that class. The derived class inherits all of the features of the parent class and typically then adds some features of its own.
By deriving classes we create what is often referred to as a class hierarchy. The class at the top of the hierarchy is known as the ''base class'' and the derived classes as ''sub classessubclasses''. Any number of classes may be derived from a class. It is only possible for a derived class to inherit from ''one'' class. As such, C# is known as a ''single inheritance'' programming language.
Classes need not only be derived from a ''base class''. For example, a sub class subclass can also inherit from another sub classsubclass.
== An Example of Inheritance ==

Navigation menu