Chapter 13: Abstract Classes, Interfaces, and Polymorphism


13.1 Introduction

As discussed in Chapter 12, inheritance is a mechanism provided by an object-oriented language for defining new classes from existing classes. Inheritance enhances class reuse, that is, the use of a class in more than one application.

Inheritance also helps in dealing with generic modeling and programming. With generics, the more general classes are separated from the more specific or concrete classes. This separation helps to enhance reuse of the more general definitions in modeling and in programming.

Abstract classes help improve the object-oriented model of the problem. They help clarify the understanding of the model and provide good specifications. Interfaces allow the introduction to pure specifications, the complete separation between specification and implementation. Polymorphism is a mechanism that allows more flexibility in the design and provides generic programming.

This chapter discusses the three important and related concepts mentioned: abstract classes, interfaces, and polymorphism.




Object-Oriented Programming(c) From Problem Solving to Java
Object-Oriented Programming (From Problem Solving to JAVA) (Charles River Media Programming)
ISBN: 1584502878
EAN: 2147483647
Year: 2005
Pages: 184

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