OOP2 Understanding Inheritance in OOP

OOP2 Understanding Inheritance in OOP

11th Grade

10 Qs

quiz-placeholder

Similar activities

CWA Java 6

CWA Java 6

11th - 12th Grade

8 Qs

Python L2- Quiz 6

Python L2- Quiz 6

5th - 12th Grade

8 Qs

AP Exam Review

AP Exam Review

11th Grade

10 Qs

Java Inheritance

Java Inheritance

9th - 12th Grade

5 Qs

Kuis Presensi PBO 2 - Sintaks Dasar Java

Kuis Presensi PBO 2 - Sintaks Dasar Java

11th Grade

5 Qs

Python Classes

Python Classes

9th - 12th Grade

11 Qs

FPA Abstraction

FPA Abstraction

1st Grade - University

10 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?