CCEA A-Level Software Systems Development CL4
Software and the Development Environment
Defining Data: Types, Variables and Classes
Program Control Structures
Objects, Classes and Data Structures
Exception Handling and Managing Input and Output
Testing an Object Oriented Application
Graphical User Interface Objects and Events
Multiple Forms and Linking to Files
Designing, Testing and Evaluating an Event Driven Application
Reasons for Systems Development and Systems Methodologies
Managing Projects
Testing Strategies
Database Concepts and Entity Relationship Modelling
Normalisation and Structured Query Language
Project Management and the Systems Approach in Practice
Defining Requirements and Documenting the Design
Building a Desktop Solution with a Database
Testing and Evaluating the Solution
Objects, Classes and Data Structures
Inheritance and the base class
- 3 things to know
- AS Unit 1
Overview
Deriving one class from another, what a subclass inherits and what it does not, calling the base constructor, overriding a method, and the is-a test for deciding whether inheritance is the right relationship.
What you need to know
Answer each one before you reveal it.
Give the alternative names for the two classes in an inheritance relationship.
Which members of a base class does a subclass inherit, and which does it not?
Questions from this subtopic
Each one with the model answer underneath.
- 1
What is inheritance?
Model answer
Inheritance lets a new class take on the attributes and methods of an existing class and then add to or change what it needs, so shared code is written once and used many times.
- 2
Which Java keyword sets up inheritance?
Model answer
Java writes inheritance with the keyword extends, as in class Manager extends Employee.
- 3
Give the alternative names for the two classes in an inheritance relationship.
Model answer
The class being inherited from is called the base class, superclass or parent class, and the class inheriting from it is the derived class, subclass or child class.
- 4
Which members of a base class does a subclass inherit, and which does it not?
Model answer
A subclass inherits the public and protected attributes and methods of its base class; constructors are not inherited, and private members exist in the object but cannot be named by the subclass.
- 5
A class Employee holds name and pay, and Manager extends Employee and adds budget. What does one Manager object hold?
Model answer
A Manager object holds name, pay and budget together, because the object carries the base class attributes as well as those the subclass declares.
- 6
What is the is-a test?
Model answer
The is-a test asks whether every object of the proposed subclass is genuinely a kind of the base class, and inheritance is only appropriate when the answer is yes.
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 Objects, Classes and Data Structures, 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.