Inheritance (OOP) (OCR A-Level Computer Science): Quizzes

📚Quizzes
Inheritance (OOP)
Sign up to keep practising.Create a free account to play more quizzes and track your progress.

Practise the questions

12 questions from this quiz

Show

What is the main purpose of inheritance in OOP?

To promote code reuse & hierarchy

Which term refers to the class from which attributes and methods are inherited?

Parent class

What is another name for a child class?

Subclass

In Python, how is inheritance established?

By passing parent as parameter

What is method overriding?

Child provides new implementation

What is the purpose of the super() function?

Access parent class methods

Can a child class have its own unique methods in addition to inherited ones?

Yes, can add unique methods

Which benefit of inheritance reduces code redundancy?

Code reusability

What is a common mistake when overriding methods?

Forgetting to call super()

What does inheritance enable regarding class hierarchy?

Extension of general to specific

When is composition preferred over inheritance?

When there's no strong 'is-a' link

What does extendability in inheritance allow?

Child classes to add/override

Join 100,000+ A-Level students studying Quizzes with us.

Select your subjects, and get access to A+ resources today.