Inheritance is the process by which one object can acquire the properties of another object. This is important because it supports the concept of hierarchical classification. If you think about it, most knowledge is made manageable by hierarchical (that is, top-down) classifications. For example, a Red Delicious apple is part of the classification apple, which in turn is part of the fruit class, which is under the larger class food. That is, the food class possesses certain qualities (edible, nutritious, and so on) that also, logically, apply to its subclass, fruit. In addition to these qualities, the fruit class has specific characteristics (juicy, sweet, and so on) that distinguish it from other food. The apple class defines those qualities specific to an apple (grows on trees, not tropical, and so on). A Red Delicious apple would, in turn, inherit all the qualities of all preceding classes and would define only those qualities that make it unique.
Without the use of hierarchies, each object would have to explicitly define all of its characteristics. Using inheritance, an object need only define those qualities that make it unique within its class. It can inherit its general attributes from its parent. Thus, it is the inheritance mechanism that makes it possible for one object to be a specific instance of a more general case.
Archives
-
▼
2008
(167)
-
▼
August
(36)
- Delay Sign an Assembly in C#
- Verify That a Strong-Named Assembly Has Not Been M...
- Give an Assembly a Strong Name in C#
- Create and Manage Strong-Named Key Pairs in C#
- Access a Program Element That Has the Same Name as...
- Selectively Include Code at Build Time in C#
- Access Command-Line Arguments in C#
- Create and Use a Code Library in C#
- Create and Use a Code Module in C#
- Short-Circuit Logical Operators in C#
- Relational and Logical Operators in C#
- Arithmetic Operators in C#
- Type Conversion of Expressions in C#
- C# Type Conversion and Casting
- The Scope and Lifetime of Variables in C sharp
- A Closer Look at Variables in C#
- C# Literals
- C# Some Output Options
- C# The bool Type
- C# Characters
- C# The Decimal Type
- C# Floating-Point Types
- C# Integers
- C# Value Types
- The C# Class Library
- C# Identifiers
- The C# Keywords
- Semicolons, Positioning, and Indentation in C#
- Handling Syntax Errors in C#
- Using the Visual Studio IDE
- Using csc.exe, the C# Command-Line Compiler
- A First Simple Program
- Inheritance
- Polymorphism
- Encapsulation
- C# Object-Oriented Programming
-
▼
August
(36)
No comments:
Post a Comment