wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Encapsulation

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which among the following best describes encapsulation?

a)

It is a way of combining various data members into a single unit

b)

It is a way of combining various member functions into a single unit

c)

It is a way of combining various data members and member functions into a single unit which can operate on any data

d)

It is a way of combining various data members and member functions that operate on those data members into a single unit

2.

If data members are private, what can we do to access them from the class object?

a)

Create public member functions to access those data members

b)

Create private member functions to access those data members

c)

Create protected member functions to access those data members

d)

Private data members can never be accessed from outside the class

3.

Encapsulation is a popular feature of __________________that helps in data hiding.

a)

OOPS

b)

ADT

c)

DT

d)

JDBC

4.

Encapsulation is a process of combining data members and

functions in a single unit called _______________ .

a)

method

b)

class

c)

value

d)

variable

5.

Encapsulation also lead to _______________ .

a)

datadase

b)

data handiling

c)

datatype

d)

data abstraction

6.

Encapsulation variables length, breadth, and height are _____________ .

a)

public

b)

private

c)

protected

d)

handel

7.
How many objects can be made from a class? 
a)
None, you make classes from objects
b)
one
c)
As many as you want
d)
All of the above
8.
What is the difference between a class and an object?
a)
A class is a blueprint to make an object
b)
An object is a blueprint to make a class
c)
A blueprint is an object to make a class
d)
Blueprint class is an object make a
9.
The wrapping up of data and functions into a single unit is called
a)
overloading
b)
class
c)
object
d)
encapsulation 
10.

Select all the given characteristic of OOP

a)

Data structures are designed such that they characterize the objects.

b)

C input/output is based on library and the processes are carried out by including functions.

c)

Programs are divided into what are known as objects.

d)

Emphasis is on data rather than procedure