02 Inheritance and Polymorphism Flashcards
attribute
fact associated with a specific object.
A ___ inherits all the features of the class it is based on
subclass
The terms derived class and child class are different names for
subclass
The terms base class and parent class are different names for
superclass
a special kind of method that is used to initialize a brand new object.
a constructor
note1
A computer is a tool that can be used to implement a plan for solving a problem.
A computer program is a set of instructions for a computer. These instructions describe the steps that the computer must follow to implement a plan.
An algorithm is a plan for solving a problem.
A person must design an algorithm.
A person must translate an algorithm into a computer program.
a process for developing a detailed algorithm by gradually adding detail to a high-level algorithm.
stepwise refinement
The name of a method should be
a verb or a short verb phrase that describes what the method does
An __ relationship exists between a subclass and its superclass, since every instance of the subclass is also an instance of the superclass at the same time.
is-a
note2
Every time you create a subclass, you are responsible for defining all of the constructors it supports. Constructors are not inherited from superclasses.
Polymorphism
different receivers can respond to the same method call in different ways.