3: Chapter 9 Flashcards
Code reuse
The practice of writing program code once and using it in many contexts.
Is-a relationship
A hierarchical connection between two categories in which one type is a specialized version of the other.
Inheritance hierarchy
A set of hierarchical relationships between classes of objects.
Inheritance (inherit)
A programming technique that allows a derived class to extend the functionality of a base class, inheriting all of its state and behavior.
Superclass
The parent class in an inheritance relationship.
Subclass
The child, or derived, class in an inheritance relationship.
Override
To implement a new version of a method to replace code that would otherwise have been inherited from a superclass.
Has-a relationship
A connection between two objects where one has a field that refers to the other. The contained object acts as part of the containing object’s state.
Substitutability
The ability of an object of a subclass to be used successfully anywhere an object of the superclass is expected.
Interface
A type that consists of a set of method declarations; when classes promise to implement an interface, you can treat those classes similarly in your code.
Abstract method
A method that is declared (as in an interface) but not implemented. Abstract methods represent the behavior that a class promises to implement when it implements an interface.
Object-oriented design
Modeling a program or system as a collection of cooperating objects, implemented as a set of classes using class hierarchies.
Refactoring
Changing a program’s internal structure without modifying its external behavior to improve simplicity, readability, maintainability, extensibility, performance, etc.
Abstract class
A Java class that cannot be instantiated, but that instead serves as a superclass to hold common code and declare abstract behavior.
Polymorphism
The ability for the same code to be used with several different types of objects and for the code to behave differently depending on the actual type of object used.