C++ OOPs Concepts & Inheritance Quiz

Quiz
•
Engineering
•
University
•
Hard
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
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
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
Similar Resources on Wayground
15 questions
GENERAL PACKET RADIO SERVICES (GPRS)

Quiz
•
University
20 questions
Asynchronous AR 2.0

Quiz
•
8th Grade - University
15 questions
PEISS

Quiz
•
University
20 questions
Robotify

Quiz
•
8th Grade - University
20 questions
DLD Unit 1 _ 2

Quiz
•
University
25 questions
Qualifier Set B

Quiz
•
University
16 questions
Basic C Programming

Quiz
•
University
15 questions
SEM-2(Python-Q1)

Quiz
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade