Home
Browse all 647 examples
Download all 647 examples
Download sample chapters
Reviews
Errata
Acknowledgments
Links on .NET
Paradoxal Press
Buy directly from Paradoxal Press at $33.99 (Save 43%)
Category: Programming
Level: Beginner to seasoned
900 pages
ISBN-10 097661322-0
ISBN-13 978-097661322-0
$59.99 USA
$79.99 CANADA
|
Chapter 12:
Inheritance, polymorphism and abstraction
Chapter 11< > Chapter 13
Listings: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Table of content:
Objective: code reuse The underlying problem A solution: class inheritance
Class inheritance
The syntax
The protected and internal protected visibility levels
Class inheritance diagram Calling a base class constructor Visibility of a base class members
Sealed classes
Virtual methods and polymorphism The underlying problem
A solution: virtual methods and polymorphism
An example
Disabling polymorphism
Abstraction The underlying problem
A solution: abstract classes and abstract methods
An example Simultaneously using the abstract and override keywords
Interfaces
Forcing a client to use an abstraction instead of an implementation Method name conflict resolution Interface extension conflict resolution Overriding the implementation of an interface method Interfaces and structures
Virtual and abstract properties, events and indexers
The is and as operator
The is operator
The as operator
Solutions for code reuse
Copyright Patrick Smacchia 2006 2007
|