SlideShare a Scribd company logo
INHERITANCE AND SUBSTITUTION
Muhammad Adil Raja
Roaming Researchers, Inc.
cbna
April 17, 2015
OUTLINE I
INTRODUCTION
A FEW IDEAS
SUBSTITUTION
FORMS OF INHERITANCE
REFERENCES
INTRODUCTION I
In this chapter we will start to investigate the concepts of
inheritance and substitution.
The intuitive and practical meanings of inheritance.
The syntax used to describe inheritance and substitution.
Some of the various forms of inheritance.
The benefits and costs of inheritance.
ABSTRACT IDEA OF INHERITANCE
PRACTICAL MEANING OF INHERITANCE I
MESSAGE SYNTAX
Data members in the parent are part of the child
Behavior defined in the parent are part of the child
Note that private aspects of the parent are part of the child,
but are not accessible within the child class.
PRIVATE, PUBLIC AND PROTECTED I
There are now three levels of visibility modifiers:
private: accessible only within the class definition (but
memory is still found in the child class, just not accessible).
public: accessible anywhere
protected: accessible within the class definition or within
the definition of child classes.
Note: Java interprets protected to mean accessible within
same package
INHERITANCE IS BOTH EXTENSION AND CONTRACTION
I
Because the behavior of a child class is strictly larger than
the behavior of the parent, the child is an extension of the
parent. (larger)
Because the child can override behavior to make it fit a
specialized situation, the child is a contraction of the
parent. (smaller)
This interplay between inheritance and overriding,
extension and contraction, is what allows object-oriented
systems to take very general tools and specialize them for
specific projects.
This interplay is ultimately the source of a great deal of the
power of OOP.
THE IS-A RULE
Our idealization of inheritance is captured in a simple
rule-of-thumb.
Try forming the English sentences “An A is-a B”. If it
“sounds right” to your ear, then A can be made a subclass
of B.
A dog is-a mammal, and therefore a dog inherits from
mammal
A car is-a engine sounds wrong, and therefore inheritance
is not natual. but a car has-a engine.
REUSE OF CODE – REUSE OF CONCEPT
Why do we use inheritance?
Basically there are two major motivations:
Reuse of code.
Methods defined in the parent can be made available to
the child without rewriting. Makes it easy to create new
abstractions.
Reuse of concept.
Methods described in the parent can be redefined and
overridden in the child.
Although no code is shared between parent and child, the
concept embodied in the definition is shared.
An example of the latter from the case study in chapter 7,
all graphical objects know how to draw.
SYNTAX FOR INHERITANCE
Languages use a variety of different syntax to indicate
inheritance:
SYNTAX OF ABSTRATION IN VARIOUS LANGUAGES
class Wall : public GraphicalObject −− c++
class Wall extends GraphicalObject −− Java
class Wall : GraphicalObject −− C#
( defclass Wall ( GraphicalObject ) ( ) ) −− CLOS
type Wall = object ( GraphicalObject ) −− Object Pascal
class Wall < GraphicalObject −− Ruby
TREES VS FORESTS
There are two common views of class hierarchies:
All classes are part of a single large class hierarchy.
Thus, there is one class that is the original ancestor of all
other classes.
Smalltalk, Java and Delphi Pascal do this.
Classes are only placed in hierarchies if they have a
relationship - results in a forest of many small hierarchies,
but no single ancestor.
C++, Objective-C, and Apple Object Pascal do this.
SMALLTALK HIERARCHY
ON SUBSTITUTION
Consider the following argument:
Instances of the subclass must possess all data areas
associated with the parent class.
Instances of the subclass must implement, through
inheritance at least (if not explicitly overridden) all
functionality defined for the parent class.
(They can also define new functionality, but that is
unimportant for the present argument).
Thus, an instance of a child class can mimic the behavior
of the parent class.
It therefore seems reasonable that a variable declared as a
parent, should be able to hold a value generated from the
child class.
SUBCLASS VS SUBTYPE
Of course, the problem with this argument is that a child
class can override a method and make arbitrary changes.
It is therefore useful to define two separate concepts:
To say that A is a subclass of B merely asserts that A is
formed using inheritance.
To say that a is a subtype of B asserts that A preserves the
meaning of all the operations in B.
It is possible to form subclasses that are not subtypes; and
(in some languages at least) form subtypes that are not
subclasses.
SYNTAX FOR OVERRIDING
SYNTAX FOR OVERRIDING
Some languages, such as C++, require that the programmer
indicate in the parent class that overriding is a potential:
class GraphicalObject {
public :
v i r t u a l void draw ( ) ; / / can be overridden
} ;
Other languages, such as Object Pascal, require a modifier in
the child class that overriding has taken place:
type
Ball = object ( GraphicalObject )
. . .
procedure draw ; override ; (∗ overriding has taken place ∗)
end
Still other languages (C#, Delphi) require indications in both
parent and child. And some languages (Smalltalk) do not
require any indication in either parent class or child class.
INTERFACES AND ABSTRACT CLASSES
An interface is similar to a class, but does not provide any
implementation.
A child class must override all methods. A middle ground is
an abstract class.
Here some methods are defined, and some (abstract
methods) are undefined.
A child class must fill in the definition for abstract methods:
SOME CODE
abstract class Window {
. . .
abstract public void paint ( ) ; / / c h i l d class must redefine
. . .
}
An interface is like an abstract class in which all methods
are abstract.
In C++ an abstract method is called a pure virtual method.
FORMA OF INHERITANCE
The choices between inheritance and overriding, subclass
and subtypes, mean that inheritance can be used in a
variety of different ways and for different purposes.
Many of these types of inheritance are given their own
special names.
We will describe some of these specialized forms of
inheritance.
Specialization.
Specification.
Construction.
Generalization or Extension.
Limitation.
Variance.
SPECIALIZATION INHERITANCE I
By far the most common form of inheritance is for
specialization.
A good example is the Java hierarchy of Graphical
components in the AWT:
Component.
Label.
Button.
TextComponent.
TextArea.
TextField.
CheckBox.
ScrollBar.
Each child class overrides a method inherited from the
parent in order to specialize the class in some way.
SPECIFICATION INHERITANCE
If the parent class is abstract, we often say that it is
providing a specification for the child class, and therefore it
is specification inheritance (a variety of specialization
inheritance).
Example: Java Event Listeners.
ActionListener, MouseListener, and so on specify behavior,
but must be subclassed.
INHERITANCE FOR CONSTRUCTION
If the parent class is used as a source for behavior, but the
child class has no is-a relationship to the parent, then we
say the child class is using inheritance for construction.
An example might be subclassing the idea of a Set from an
existing List class.
Generally not a good idea, since it can break the principle
of substituability, but nevertheless sometimes found in
practice. (More often in dynamically typed languages, such
as Smalltalk).
INHERITANCE FOR GENERALIZATION OR EXTENSION
If a child class generalizes or extends the parent class by
providing more functionality, but does not override any
method, we call it inheritance for generalization.
The child class doesn’t change anything inherited from the
parent, it simply adds new features.
An example is Java Properties inheriting form Hashtable.
INHERITANCE FOR LIMITATION
If a child class overrides a method inherited from the
parent in a way that makes it unusable (for example, issues
an error message), then we call it inheritance for limitation.
For example, you have an existing List data type that
allows items to be inserted at either end, and you override
methods allowing insertion at one end in order to create a
Stack.
Generally not a good idea, since it breaks the idea of
substitution.
But again, it is sometimes found in practice.
INHERITANCE FOR VARIANCE
Two or more classes that seem to be related, but its not
clear who should be the parent and who should be the
child.
Example: Mouse and TouchPad and JoyStick.
Better solution, abstract out common parts to new parent
class, and use subclassing for specialization.
SUMMARY OF FORMS OF INHERITANCE I
SPECIALIZATION: The child class is a special case of the parent
class; in other words, the child class is a subtype
of the parent class.
SPECIFICATION: The parent class defines behavior that is
implemented in the child class but not in the
parent class.
CONSTRUCTION: The child class makes use of the behavior
provided by the parent class, but is not a subtype
of the parent class.
GENERALIZATION: The child class modifies or overrides some
of the methods of the parent class.
EXTENSION: The child class adds new functionality to the
parent class, but does not change any inherited
behavior.
SUMMARY OF FORMS OF INHERITANCE II
LIMITATION: The child class restricts the use of some of the
behavior inherited from the parent class.
VARIANCE: The child class and parent class are variants of
each other, and the class-subclass relationship is
arbitrary.
COMBINATION: The child class inherits features from more than
one parent class. This is multiple inheritance and
will be the subject of a later chapter.
BENEFITS OF INHERITANCE
Software Reuse.
Code Sharing.
Improved Reliability.
Consistency of Interface.
Rapid Prototyping.
Polymorphism.
Information Hiding.
COST OF INHERITANCE
Execution speed.
Program size.
Message Passing Overhead.
Program Complexity.
This does not mean you should not use inheritance, but
rather than you must understand the benefits, and weigh
the benefits against the costs.
SUMMARY
In this chapter we have begun the exploration of
inheritance, a topic we will continue through the next
several chapters.
Topics we have addressed have included the following:
The meaning of inheritance.
The syntax used to describe inheritance and overriding.
The idea of substitution of a child class for a parent.
The various forms of inheritance.
The cost and benefits of inheritance.
REFERENCES I
Images and content for developing these slides have been
taken from the follwoing book with the permission of the
author.
An Introduction to Object Oriented Programming, Timothy
Budd.
This presentation is developed using Beamer:
Berlin, monarca.

More Related Content

PPT
PPTX
Java OOPS Concept
PDF
Multiple Inheritance
PPTX
Python: Multiple Inheritance
PDF
Object Oriented Programming using C++ Part II
PPT
Unit 3 Java
PPTX
Abstraction and Encapsulation
PDF
Abstraction
Java OOPS Concept
Multiple Inheritance
Python: Multiple Inheritance
Object Oriented Programming using C++ Part II
Unit 3 Java
Abstraction and Encapsulation
Abstraction

Similar to Inheritance and Substitution (20)

PPTX
Inheritance in Java - An Introduction & types
PPTX
SAD04 - Inheritance
DOCX
OOPS ABAP.docx
PPT
Java inheritance
PPTX
General oops concepts
PDF
Java programming -Object-Oriented Thinking- Inheritance
PPT
Object Oriented Relationships
PPTX
Introduction to OOP.pptx
PPTX
java part 1 computer science.pptx
DOCX
Java OOPs Concepts.docx
PPSX
Dr. Rajeshree Khande : Java Inheritance
PDF
Advanced Programming _Abstract Classes vs Interfaces (Java)
PPTX
Abstract Class Presentation
PPTX
Abstract Class Presentation
PDF
Object oriented programming
PDF
Object And Oriented Programing ( Oop ) Languages
DOC
Research paper
PPTX
CSharp_03_Inheritance_introduction_with_examples
PDF
Subclasses and Subtypes
PPT
Inheritance and its necessity in java.ppt
Inheritance in Java - An Introduction & types
SAD04 - Inheritance
OOPS ABAP.docx
Java inheritance
General oops concepts
Java programming -Object-Oriented Thinking- Inheritance
Object Oriented Relationships
Introduction to OOP.pptx
java part 1 computer science.pptx
Java OOPs Concepts.docx
Dr. Rajeshree Khande : Java Inheritance
Advanced Programming _Abstract Classes vs Interfaces (Java)
Abstract Class Presentation
Abstract Class Presentation
Object oriented programming
Object And Oriented Programing ( Oop ) Languages
Research paper
CSharp_03_Inheritance_introduction_with_examples
Subclasses and Subtypes
Inheritance and its necessity in java.ppt
Ad

More from adil raja (20)

PDF
ANNs.pdf
PDF
A Software Requirements Specification
PDF
NUAV - A Testbed for Development of Autonomous Unmanned Aerial Vehicles
PDF
DevOps Demystified
PDF
On Research (And Development)
PDF
Simulators as Drivers of Cutting Edge Research
PDF
The Knock Knock Protocol
PDF
File Transfer Through Sockets
PDF
Remote Command Execution
PDF
Thesis
PDF
CMM Level 3 Assessment of Xavor Pakistan
PDF
Data Warehousing
PDF
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
PDF
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
PDF
Real-Time Non-Intrusive Speech Quality Estimation for VoIP
PDF
VoIP
PDF
ULMAN GUI Specifications
PDF
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
PDF
ULMAN-GUI
PDF
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
ANNs.pdf
A Software Requirements Specification
NUAV - A Testbed for Development of Autonomous Unmanned Aerial Vehicles
DevOps Demystified
On Research (And Development)
Simulators as Drivers of Cutting Edge Research
The Knock Knock Protocol
File Transfer Through Sockets
Remote Command Execution
Thesis
CMM Level 3 Assessment of Xavor Pakistan
Data Warehousing
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
Real-Time Non-Intrusive Speech Quality Estimation for VoIP
VoIP
ULMAN GUI Specifications
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
ULMAN-GUI
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
Ad

Recently uploaded (20)

PPTX
Institutional Correction lecture only . . .
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Classroom Observation Tools for Teachers
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Complications of Minimal Access Surgery at WLH
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Insiders guide to clinical Medicine.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
master seminar digital applications in india
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Microbial disease of the cardiovascular and lymphatic systems
Institutional Correction lecture only . . .
O7-L3 Supply Chain Operations - ICLT Program
Classroom Observation Tools for Teachers
PPH.pptx obstetrics and gynecology in nursing
Complications of Minimal Access Surgery at WLH
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Insiders guide to clinical Medicine.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
master seminar digital applications in india
FourierSeries-QuestionsWithAnswers(Part-A).pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Final Presentation General Medicine 03-08-2024.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
2.FourierTransform-ShortQuestionswithAnswers.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Microbial disease of the cardiovascular and lymphatic systems

Inheritance and Substitution

  • 1. INHERITANCE AND SUBSTITUTION Muhammad Adil Raja Roaming Researchers, Inc. cbna April 17, 2015
  • 2. OUTLINE I INTRODUCTION A FEW IDEAS SUBSTITUTION FORMS OF INHERITANCE REFERENCES
  • 3. INTRODUCTION I In this chapter we will start to investigate the concepts of inheritance and substitution. The intuitive and practical meanings of inheritance. The syntax used to describe inheritance and substitution. Some of the various forms of inheritance. The benefits and costs of inheritance.
  • 4. ABSTRACT IDEA OF INHERITANCE
  • 5. PRACTICAL MEANING OF INHERITANCE I MESSAGE SYNTAX Data members in the parent are part of the child Behavior defined in the parent are part of the child Note that private aspects of the parent are part of the child, but are not accessible within the child class.
  • 6. PRIVATE, PUBLIC AND PROTECTED I There are now three levels of visibility modifiers: private: accessible only within the class definition (but memory is still found in the child class, just not accessible). public: accessible anywhere protected: accessible within the class definition or within the definition of child classes. Note: Java interprets protected to mean accessible within same package
  • 7. INHERITANCE IS BOTH EXTENSION AND CONTRACTION I Because the behavior of a child class is strictly larger than the behavior of the parent, the child is an extension of the parent. (larger) Because the child can override behavior to make it fit a specialized situation, the child is a contraction of the parent. (smaller) This interplay between inheritance and overriding, extension and contraction, is what allows object-oriented systems to take very general tools and specialize them for specific projects. This interplay is ultimately the source of a great deal of the power of OOP.
  • 8. THE IS-A RULE Our idealization of inheritance is captured in a simple rule-of-thumb. Try forming the English sentences “An A is-a B”. If it “sounds right” to your ear, then A can be made a subclass of B. A dog is-a mammal, and therefore a dog inherits from mammal A car is-a engine sounds wrong, and therefore inheritance is not natual. but a car has-a engine.
  • 9. REUSE OF CODE – REUSE OF CONCEPT Why do we use inheritance? Basically there are two major motivations: Reuse of code. Methods defined in the parent can be made available to the child without rewriting. Makes it easy to create new abstractions. Reuse of concept. Methods described in the parent can be redefined and overridden in the child. Although no code is shared between parent and child, the concept embodied in the definition is shared. An example of the latter from the case study in chapter 7, all graphical objects know how to draw.
  • 10. SYNTAX FOR INHERITANCE Languages use a variety of different syntax to indicate inheritance: SYNTAX OF ABSTRATION IN VARIOUS LANGUAGES class Wall : public GraphicalObject −− c++ class Wall extends GraphicalObject −− Java class Wall : GraphicalObject −− C# ( defclass Wall ( GraphicalObject ) ( ) ) −− CLOS type Wall = object ( GraphicalObject ) −− Object Pascal class Wall < GraphicalObject −− Ruby
  • 11. TREES VS FORESTS There are two common views of class hierarchies: All classes are part of a single large class hierarchy. Thus, there is one class that is the original ancestor of all other classes. Smalltalk, Java and Delphi Pascal do this. Classes are only placed in hierarchies if they have a relationship - results in a forest of many small hierarchies, but no single ancestor. C++, Objective-C, and Apple Object Pascal do this.
  • 13. ON SUBSTITUTION Consider the following argument: Instances of the subclass must possess all data areas associated with the parent class. Instances of the subclass must implement, through inheritance at least (if not explicitly overridden) all functionality defined for the parent class. (They can also define new functionality, but that is unimportant for the present argument). Thus, an instance of a child class can mimic the behavior of the parent class. It therefore seems reasonable that a variable declared as a parent, should be able to hold a value generated from the child class.
  • 14. SUBCLASS VS SUBTYPE Of course, the problem with this argument is that a child class can override a method and make arbitrary changes. It is therefore useful to define two separate concepts: To say that A is a subclass of B merely asserts that A is formed using inheritance. To say that a is a subtype of B asserts that A preserves the meaning of all the operations in B. It is possible to form subclasses that are not subtypes; and (in some languages at least) form subtypes that are not subclasses.
  • 15. SYNTAX FOR OVERRIDING SYNTAX FOR OVERRIDING Some languages, such as C++, require that the programmer indicate in the parent class that overriding is a potential: class GraphicalObject { public : v i r t u a l void draw ( ) ; / / can be overridden } ; Other languages, such as Object Pascal, require a modifier in the child class that overriding has taken place: type Ball = object ( GraphicalObject ) . . . procedure draw ; override ; (∗ overriding has taken place ∗) end Still other languages (C#, Delphi) require indications in both parent and child. And some languages (Smalltalk) do not require any indication in either parent class or child class.
  • 16. INTERFACES AND ABSTRACT CLASSES An interface is similar to a class, but does not provide any implementation. A child class must override all methods. A middle ground is an abstract class. Here some methods are defined, and some (abstract methods) are undefined. A child class must fill in the definition for abstract methods: SOME CODE abstract class Window { . . . abstract public void paint ( ) ; / / c h i l d class must redefine . . . } An interface is like an abstract class in which all methods are abstract. In C++ an abstract method is called a pure virtual method.
  • 17. FORMA OF INHERITANCE The choices between inheritance and overriding, subclass and subtypes, mean that inheritance can be used in a variety of different ways and for different purposes. Many of these types of inheritance are given their own special names. We will describe some of these specialized forms of inheritance. Specialization. Specification. Construction. Generalization or Extension. Limitation. Variance.
  • 18. SPECIALIZATION INHERITANCE I By far the most common form of inheritance is for specialization. A good example is the Java hierarchy of Graphical components in the AWT: Component. Label. Button. TextComponent. TextArea. TextField. CheckBox. ScrollBar. Each child class overrides a method inherited from the parent in order to specialize the class in some way.
  • 19. SPECIFICATION INHERITANCE If the parent class is abstract, we often say that it is providing a specification for the child class, and therefore it is specification inheritance (a variety of specialization inheritance). Example: Java Event Listeners. ActionListener, MouseListener, and so on specify behavior, but must be subclassed.
  • 20. INHERITANCE FOR CONSTRUCTION If the parent class is used as a source for behavior, but the child class has no is-a relationship to the parent, then we say the child class is using inheritance for construction. An example might be subclassing the idea of a Set from an existing List class. Generally not a good idea, since it can break the principle of substituability, but nevertheless sometimes found in practice. (More often in dynamically typed languages, such as Smalltalk).
  • 21. INHERITANCE FOR GENERALIZATION OR EXTENSION If a child class generalizes or extends the parent class by providing more functionality, but does not override any method, we call it inheritance for generalization. The child class doesn’t change anything inherited from the parent, it simply adds new features. An example is Java Properties inheriting form Hashtable.
  • 22. INHERITANCE FOR LIMITATION If a child class overrides a method inherited from the parent in a way that makes it unusable (for example, issues an error message), then we call it inheritance for limitation. For example, you have an existing List data type that allows items to be inserted at either end, and you override methods allowing insertion at one end in order to create a Stack. Generally not a good idea, since it breaks the idea of substitution. But again, it is sometimes found in practice.
  • 23. INHERITANCE FOR VARIANCE Two or more classes that seem to be related, but its not clear who should be the parent and who should be the child. Example: Mouse and TouchPad and JoyStick. Better solution, abstract out common parts to new parent class, and use subclassing for specialization.
  • 24. SUMMARY OF FORMS OF INHERITANCE I SPECIALIZATION: The child class is a special case of the parent class; in other words, the child class is a subtype of the parent class. SPECIFICATION: The parent class defines behavior that is implemented in the child class but not in the parent class. CONSTRUCTION: The child class makes use of the behavior provided by the parent class, but is not a subtype of the parent class. GENERALIZATION: The child class modifies or overrides some of the methods of the parent class. EXTENSION: The child class adds new functionality to the parent class, but does not change any inherited behavior.
  • 25. SUMMARY OF FORMS OF INHERITANCE II LIMITATION: The child class restricts the use of some of the behavior inherited from the parent class. VARIANCE: The child class and parent class are variants of each other, and the class-subclass relationship is arbitrary. COMBINATION: The child class inherits features from more than one parent class. This is multiple inheritance and will be the subject of a later chapter.
  • 26. BENEFITS OF INHERITANCE Software Reuse. Code Sharing. Improved Reliability. Consistency of Interface. Rapid Prototyping. Polymorphism. Information Hiding.
  • 27. COST OF INHERITANCE Execution speed. Program size. Message Passing Overhead. Program Complexity. This does not mean you should not use inheritance, but rather than you must understand the benefits, and weigh the benefits against the costs.
  • 28. SUMMARY In this chapter we have begun the exploration of inheritance, a topic we will continue through the next several chapters. Topics we have addressed have included the following: The meaning of inheritance. The syntax used to describe inheritance and overriding. The idea of substitution of a child class for a parent. The various forms of inheritance. The cost and benefits of inheritance.
  • 29. REFERENCES I Images and content for developing these slides have been taken from the follwoing book with the permission of the author. An Introduction to Object Oriented Programming, Timothy Budd. This presentation is developed using Beamer: Berlin, monarca.