OOP2 Understanding Inheritance in OOP
Quiz
•
Computers
•
11th Grade
•
Practice Problem
•
Medium
A Beacham
Used 22+ times
FREE Resource
Enhance your content in a minute
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Disk Management and Boot Sequence Vocab
Quiz
•
9th - 12th Grade
10 questions
Working with tables
Quiz
•
5th - 12th Grade
10 questions
E-Tech Lesson 1
Quiz
•
11th Grade
11 questions
Cascading Style Sheets
Quiz
•
8th - 12th Grade
15 questions
REVISION-Primary & Secondary Storage
Quiz
•
10th - 11th Grade
14 questions
1.1 Data and information
Quiz
•
10th - 12th Grade
15 questions
Chapter 3: Storage devices and media (Part 2):
Quiz
•
10th - 11th Grade
11 questions
What is a computer
Quiz
•
KG - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
