Search Header Logo

Inheritance in Object-Oriented Programming

Authored by Justine Nichol Pasamonte

Other

University

Used 2+ times

Inheritance in Object-Oriented Programming
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

A software development team wants to reuse code across different vehicle types such as Car, Bus, and Motorcycle. They all share features like move() and brake() from a Vehicle class. Which inheritance type should they implement to maximize code reuse?

Single Inheritance

Multilevel Inheritance

Hierarchical Inheritance

Multiple Inheritance

2.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

A developer has a base class Employee and a derived class Manager. They need to access a private member salary of Employee from Manager. Which of the following should they implement?

Directly call the private variable using object reference

Redefine salary in the derived class

Use a getter function defined in the base class

Make the derived class static

3.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

You are working on a student management system. The base class is Person, and the derived classes are Teacher and Student. Which inheritance type best fits this design?

Hybrid Inheritance

Multiple Inheritance

Hierarchical Inheritance

Multilevel Inheritance

4.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

In a hybrid inheritance setup, you encounter ambiguity accessing a function from the common base class through two different base classes. Which issue are you facing?

Access Violation Error

Segmentation Fault

Diamond Problem

Type Casting Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

A developer uses private inheritance for a class Logger inherited by Application. What is the access level of the public members of Logger inside Application?

Public

Protected

Private

Inaccessible

6.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

A company has a class structure where CEO inherits from Manager, and Manager inherits from Employee. Which type of inheritance does this represent?

Single

Multiple

Multilevel

Hierarchical

7.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

A base class Shape has a method draw(). Two derived classes Circle and Square override this method. What OOP concept does this illustrate?

Abstraction

Tight Coupling

Polymorphism

Hybrid Inheritance

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?