C++ OOPs Concepts & Inheritance Quiz

C++ OOPs Concepts & Inheritance Quiz

University

20 Qs

quiz-placeholder

Similar activities

Object-Oriented Programming Quiz

Object-Oriented Programming Quiz

University

15 Qs

Software Reuse Quiz

Software Reuse Quiz

University

20 Qs

SEM-2(Python-Q1)

SEM-2(Python-Q1)

University

15 Qs

Mastering Python Programming Concepts

Mastering Python Programming Concepts

University

20 Qs

ETS Pemrograman Berorientasi Obyek

ETS Pemrograman Berorientasi Obyek

University

15 Qs

Hackharbor 3.0 Day 3:C

Hackharbor 3.0 Day 3:C

University

20 Qs

2.3.4 - NSPE Code of Ethics

2.3.4 - NSPE Code of Ethics

10th Grade - University

15 Qs

Basic C Programming

Basic C Programming

University

16 Qs

C++ OOPs Concepts & Inheritance Quiz

C++ OOPs Concepts & Inheritance Quiz

Assessment

Quiz

Engineering

University

Hard

Created by

Shrutika Nakadi

Used 5+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is not a feature of OOP in C++?

Encapsulation

Abstraction

Inheritance

Compilation

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the default access specifier for members of a class in C++?

Public

Private

Protected

Internal

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What type of inheritance is shown in the following code? class A { }; class B : public A { }; class C : public B { };

Single inheritance

Multiple inheritance

Multilevel inheritance

Hybrid inheritance

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of this code? class Base { public: void show() { cout << "Base class"; } }; class Derived : public Base { public: void show() { cout << "Derived class"; } }; int main() { Derived d; d.show(); return 0; }

Base class

Derived class

Error

Nothing

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which keyword is used to inherit a class in C++?

inherit

extends

using

:

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is not a C++ token?

Identifier

Keyword

Punctuation

Class

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of this code snippet? class A { public: int x = 10; }; class B : public A { public: void display() { cout << x; } }; int main() { B obj; obj.display(); return 0; }

Error

10

0

Garbage value

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?