OOP2 Understanding Inheritance in OOP

OOP2 Understanding Inheritance in OOP

11th Grade

10 Qs

quiz-placeholder

Similar activities

Coding Quiz 3

Coding Quiz 3

9th - 12th Grade

12 Qs

Day 42 SQ: Classes and Objects Java

Day 42 SQ: Classes and Objects Java

10th - 12th Grade

12 Qs

CS Data Structure Quiz

CS Data Structure Quiz

11th Grade

15 Qs

CodeHS 4.14 Polymorphism

CodeHS 4.14 Polymorphism

9th - 12th Grade

10 Qs

Review activity Fernandes & Do

Review activity Fernandes & Do

9th - 12th Grade

10 Qs

Latihan_106

Latihan_106

11th Grade

15 Qs

Python Classes Quiz

Python Classes Quiz

9th - 12th Grade

15 Qs

APCSA Inheritance

APCSA Inheritance

10th - 12th Grade

5 Qs

OOP2 Understanding Inheritance in OOP

OOP2 Understanding Inheritance in OOP

Assessment

Quiz

Computers

11th Grade

Medium

Created by

Amanda Beacham

Used 12+ 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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?