CCEA A-Level Digital Technology 2650
Systems Analysis and Development Approaches
Design, Development and Testing
Implementation and System Security
Programming
Data, Information and Data Representation
Computer Architecture and Processing Systems
System Software, Application Software and the User Interface
Web Technology and Multimedia
Networks
Databases
Artificial Intelligence, Expert Systems and Robotics
Mobile Technology, Data Mining and Cloud Computing
Individual, Social and Legal Considerations
The Development Project: Analysis and Design
The Development Project: Build, Testing and Evaluation
Programming
Inheritance and evaluating the object-oriented approach
- 3 things to know
- AS Unit 1
Overview
Method overriding, superclass with two sensible subclasses and class hierarchy.
What you need to know
Answer each one before you reveal it.
Give two advantages of the object-oriented approach.
Why does the object-oriented approach make maintenance easier?
Questions from this subtopic
Each one with the model answer underneath.
- 1
Define inheritance.
Model answer
Inheritance is the mechanism by which a new class takes on the attributes and methods of an existing class, and may then add further ones of its own or change what it has received.
- 2
What names are given to the two classes in an inheritance relationship?
Model answer
The class being inherited from is called the superclass, parent or base class, and the class inheriting from it is called the subclass, child or derived class.
- 3
Give one reason inheritance reduces the amount of code that has to be written.
Model answer
Anything common to several kinds of object is written once in the superclass, and each subclass inherits it rather than repeating it.
- 4
What is method overriding?
Model answer
Method overriding is the replacement of an inherited method by a subclass's own version, so that objects of the subclass behave differently while the method keeps the same name.
- 5
Give an example of a superclass with two sensible subclasses.
Model answer
A superclass called Account could have the subclasses Current Account and Savings Account, each inheriting the balance attribute and adding rules of its own.
- 6
What is a class hierarchy?
Model answer
A class hierarchy is the tree of classes formed when subclasses inherit from a superclass and are themselves inherited from, with the most general class at the top.
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in Programming, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.