wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

OOP Concepts Quiz

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

Which is not an OOP concept?

a)

Abstraction

b)

Polymorphism

c)

Encapsulation

d)

Preprocessing

2.

Object is a/an:

a)

Instance of class

b)

Function

c)

Variable

d)

Operator

3.

Combining data and methods is:

a)

Encapsulation

b)

Inheritance

c)

Polymorphism

d)

Overloading

4.

Hiding implementation details is:

a)

Abstraction

b)

Overloading

c)

Template

d)

Virtualization

5.

Blueprint of objects is:

a)

Class

b)

Constructor

c)

Function

d)

Template

6.

Dynamic binding is also called:

a)

Early binding

b)

Static binding

c)

Late binding

d)

Constant binding

7.

Overriding requires:

a)

Same signature

b)

Different class

c)

Different scope

d)

Different parameters

8.

Overloading requires:

a)

Different parameters

b)

Same parameters

c)

Different classes

d)

Virtual keyword

9.

The 'this' pointer refers to:

a)

Base class

b)

Calling object

c)

Global object

d)

Derived class

10.

Destructor symbol is:

a)

@

b)

#

c)

~

d)

%

11.

Copy constructor takes argument as:

a)

By value

b)

Pointer

c)

Reference

d)

Integer

12.

Which cannot be overloaded?

a)

Constructor

b)

Destructor

c)

Assignment operator

d)

Function

13.

Deep copy copies:

a)

Pointer address only

b)

Object + dynamic data

c)

Only static members

d)

Only code

14.

IS-A relationship represents:

a)

Aggregation

b)

Inheritance

c)

Composition

d)

Encapsulation

15.

To solve diamond problem, we use:

a)

static

b)

template

c)

virtual inheritance

d)

overriding

16.

Which inheritance causes ambiguity?

a)

Multiple

b)

Single

c)

Hierarchical

d)

Multilevel

17.

Upcasting converts:

a)

Derived → Base

b)

Base → Derived

c)

Class → Object

d)

Pointer → Reference

18.

Pure virtual function makes a class:

a)

Final

b)

Abstract

c)

Static

d)

Friend

19.

Virtual function enables:

a)

Static binding

b)

Dynamic binding

c)

Compiler error

d)

Abstraction only

20.

Which operator cannot be overloaded?

a)

+

b)

=

c)

::

d)

[]

21.

Virtual destructor ensures:

a)

Fast execution

b)

Proper derived cleanup

c)

No inheritance

d)

File closure

22.

Templates implement:

a)

Polymorphism

b)

Exception

c)

Generic programming

d)

File handling

23.

Template specialization means:

a)

Custom version for specific type

b)

Overloading

c)

Exception

d)

Memory allocation

24.

vtable stores:

a)

Functions

b)

Virtual function pointers

c)

Objects

d)

Exceptions

25.

vptr is maintained by:

a)

User

b)

Compiler

c)

OS

d)

Linker

26.

Exceptions are handled using:

a)

if else

b)

try-catch

c)

loops

d)

static

27.

throw keyword is used to:

a)

Catch error

b)

Generate exception

c)

Close file

d)

Debug program

28.

catch(...) catches:

a)

int only

b)

string only

c)

Any exception

d)

none

29.

std::bad_alloc indicates:

a)

File missing

b)

Memory allocation failure

c)

Type mismatch

d)

Syntax error

30.

Uncaught exceptions lead to:

a)

Program crash

b)

Restart

c)

Continue

d)

Error message only

31.

The block that must follow try is:

a)

for

b)

if

c)

catch

d)

switch

32.

Serialization means:

a)

Sorting data

b)

Storing object to file

c)

Converting to float

d)

Allocating memory

33.

RTTI is used for:

a)

Type conversion

b)

Compile-time checking

c)

Runtime type checking

d)

Memory optimization

34.

Which guarantees deep copy?

a)

Default copy constructor

b)

Shallow copy

c)

Custom copy constructor

d)

Assignment operator

35.

If destructor is not virtual, deleting base pointer causes:

a)

Compilation error

b)

Memory leak

c)

No issue

d)

Faster execution

36.

explicit keyword is used to:

a)

Disable implicit conversions

b)

Enable polymorphism

c)

Support templates

d)

Make variables static

37.

Which feature reduces redundancy?

a)

Polymorphism

b)

Abstraction

c)

Inheritance

d)

Composition

38.

Function overriding means:

a)

Redefining method in derived class

b)

Using same name with different parameters

c)

Using templates

d)

Changing return type

39.

The safest cast in C++ is:

a)

static_cast

b)

reinterpret_cast

c)

const_cast

d)

dynamic_cast

40.

Object slicing is:

a)

Base copy loses derived data

b)

Cutting memory

c)

Splitting classes

d)

Changing pointer type