Year 11
Lesson details
Key learning points
- In this lesson, we will learn about a key principle of object-oriented programming - Inheritance. We will use it to create new monster classes for the Monster Quest puzzle game. These new classes will inherit all the attributes and methods of the original monster class and add some new ones all their own!
Licence
This content is made available by Oak National Academy Limited and its partners and licensed under Oak’s terms & conditions (Collection 1), except where otherwise stated.
Loading...
4 Questions
Q1.
In this piece of code, zombie is a...
Attribute
Class
Method
Q2.
When you create a new object from a class you need to use a...
Attribute
Getter
Method
Q3.
To access the name of the Monster in this code which line in correct?
print(zombie.name)
Q4.
An object is a structure that contains...
A whole program
Data
Methods
4 Questions
Q1.
When using inheritance in your object-oriented programs, you can create a new class that inherits from a class that already exists. What is the original class called?
Instance
Object
Subclass
Q2.
When you create a new class with Inheritance - what is the class that is created called?
Constructor
Instance
Superclass
Q3.
When you use inheritance what does the new class inherit?
Just Attributes
Just Methods
Nothing
Q4.
Which of these class declarations is using inheritance?
class NewVehicle():
class Vehicle():