Year 11
Lesson details
Key learning points
- In this lesson, we will explore a program written using OOP. We will use our experience to first investigate and then modify the program. Finally, we will add a new subclass to the program and apply the principle of inheritance.
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.
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():
5 Questions
Q1.
Which of the following are examples of classes used in the example program? (Tick 2 boxes)
book.py
hunger_games
jane
Q2.
Which of the following are examples of objects used in the example program? (Tick 2 boxes)
book.py
Library
User
Q3.
Which of the following is a method in the Book class?
author
self
title
Q4.
Which of the following is an example of an attribute in the Library class?
__init__
add_user
list_books_author
Q5.
To create a new object of the Book class which of the following lines of code would you use?
book_object = Book.__init__(self)
book_object = new Book
Book()