Quiz on Inheritance in C++

Quiz on Inheritance in C++

12th Grade

10 Qs

quiz-placeholder

Similar activities

C++ Quiz for Grade 12 Students

C++ Quiz for Grade 12 Students

12th Grade

10 Qs

Python Scoping

Python Scoping

12th Grade

10 Qs

MTA: 98-367 Security Part 3

MTA: 98-367 Security Part 3

KG - Professional Development

15 Qs

Coding Pre Test

Coding Pre Test

9th - 12th Grade

15 Qs

Python Abstraction

Python Abstraction

12th Grade

10 Qs

XII Samacheer Computer Science

XII Samacheer Computer Science

12th Grade - University

10 Qs

Inheritance in C++

Inheritance in C++

12th Grade

10 Qs

Symbol Puzzle Recap

Symbol Puzzle Recap

12th Grade

10 Qs

Quiz on Inheritance in C++

Quiz on Inheritance in C++

Assessment

Quiz

Computers

12th Grade

Medium

Created by

Julie Yee

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the main purpose of inheritance in C++?

To allow new classes to reuse code from existing classes

To increase the complexity of the code

To eliminate the need for classes

To create new classes from scratch

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which type of inheritance allows a derived class to inherit from multiple base classes?

Multiple Inheritance

Single Inheritance

Hierarchical Inheritance

Multilevel Inheritance

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What happens to public members of a base class when inherited using private inheritance?

They become private in the derived class

They remain public in the derived class

They become protected in the derived class

They are inaccessible in the derived class

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

In C++, which access specifier allows members to be accessible only within the class itself?

Protected

Public

Default

Private

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the default access control for members of a derived class if no access specifier is provided?

Protected

Default

Public

Private

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the visibility of private members of a base class in a derived class?

Public

Inaccessible

Protected

Accessible

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

  1. Which type of inheritance is most commonly used in C++?

Private inheritance

Protected inheritance

Public inheritance

Default inheritance

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?