ADBRITE ads links
You are here: CodeIdol.com > C# > Learning C# 2005 > Inheritance And Polymorphism
Learning C# 2005
| 11.1. Specialization and Generalization
Classes and their instances (objects) do not exist in a vacuum, but rather in a network of interdependencies and relationships, just as we, as social animals, live in a world of relationshi...
|
|
| 11.2. Inheritance
In C#, the specialization
relationship is implemented using a principle called inheritance
. This is not the only way to implement specialization, but it is the most common and most natural way to imp...
|
|
| 11.3. Polymorphism
There are two powerful aspects to inheritance. One is code reuse. When you create a ListBox class, you're able to reuse some of the logic in the base (Window) class.
What is arguably more powerful, however, is the second aspect...
|
|
| 11.4. Abstract Classes
Each type of Window has a different shape and appearance. Drop-down listboxes look very different from buttons. Clearly, every subclass of Window should implement its own DrawWindow( ) methodbut so far, no...
|
|
| 11.5. Sealed Classes
The opposite side of the design coin from abstract is sealed
. In contrast to an abstract class, which is intended to be derived from and to provide a template for its subclasses to follow, a sealed class does not allow c...
|
|
| 11.6. The Root of All Classes: Object
All C# classes, of any type, ultimately derive from a single class: Object. Object is the base class for all other classes.
A base class is the immediate "parent" of a derived class. A de...
|
|
| 11.7. Boxing and Unboxing Types
Boxing and unboxing
are the processes that enable value types
(such as, integers) to be treated as reference types (objects). The value is "boxed" inside an Object and subsequently "unboxed" back t...
|
|
| 11.8. Summary
Specialization is described as the is-a relationship; the reverse of specialization is generalization.Specialization and generalization are reciprocal and hierarchicalthat is, specialization is reciprocal to generalization, and each ...
|
|
| 11.9. Quiz
Question 111
What is the relationship between specialization and generalization?
Question 112
How is specialization implemented in C#?
Question 113
What is the syntax for inheritance in C#?
Question 114
How do you impleme...
|
|
You are here: CodeIdol.com > C# > Learning C# 2005 > Inheritance And Polymorphism
|
|
Related tags
Popular Categories
Unix books and guides
AJAX popular information
C# language guides
Windows books and cookbooks
.......
|
|