OOP2 Understanding Inheritance in OOP

Quiz
•
Computers
•
11th Grade
•
Medium

Amanda Beacham
Used 13+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is inheritance in object-oriented programming?
A mechanism to create private attributes
A way to reuse code by creating a new class from an existing class
A method to delete attributes from a class
A process to convert a class into a function
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the context of the provided example, what is the superclass of the `Employee` class?
LightBulb
Person
SalariedEmployee
HourlyPaidEmployee
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a derived class in the given example?
Person
Employee
LightBulb
Method
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of overriding a method in a subclass?
To delete the method from the superclass
To provide a more specific implementation of a method in the subclass
To create a new class
To change the class name
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you call a method from the superclass if it has been overridden in the subclass?
By using the `super` keyword
By renaming the method
By deleting the subclass method
By using the `override` keyword
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the example, what additional attribute does the `Employee` class have compared to the `Person` class?
Date of Birth
National Insurance Number
Salary
Job Title
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the relationship between `SalariedEmployee` and `Employee` in the example?
`SalariedEmployee` is a superclass of `Employee`
`SalariedEmployee` is a subclass of `Employee`
They are unrelated
They are the same class
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Python Generators

Quiz
•
10th Grade - University
10 questions
PF 3.06 Lifelong Employment

Quiz
•
9th - 12th Grade
10 questions
Pewarisan Antar Interface

Quiz
•
11th Grade
5 questions
Java Inheritance

Quiz
•
9th - 12th Grade
10 questions
Latihan Class Library

Quiz
•
9th - 12th Grade
15 questions
Pemrograman Berorientasi Objek PAS Ganjil XI RPL

Quiz
•
11th Grade
10 questions
HAIT Impact of ICT

Quiz
•
11th Grade
10 questions
Creative tech summative exam

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade