Class 12 Computer Science · Chapter 3 · Test 2
Encapsulation
36 MCQs
36 questions · 30 min · 36 marks
Want to try first? Take the free Computer Science test: Networks Basics
Sample questions
The first 5 of 36. Try each one, then tap to see the answer.
Question 1
The OOP concept that hides data inside a class is:
- AInheritance
- BPolymorphism
- CEncapsulation
- DAbstraction
Show answerHide answer
Answer: C
Encapsulation hides data inside a class and controls access to it.
Question 2
Encapsulation bundles data and methods into:
- AMany separate files
- BA database
- CA table
- DA single class
Show answerHide answer
Answer: D
Data and methods are combined in a single unit called a class.
Question 3
The main idea behind encapsulation in OOP is:
- ATo hide data inside a class and prevent unauthorised access
- BTo create a flexible and adaptable programme
- CTo reuse code from other classes
- DTo allow multiple inheritance in classes
Show answerHide answer
Answer: A
Encapsulation hides data and prevents unauthorised access.
Question 4
Encapsulation is best described as:
- ACombining data and methods into a single unit and controlling access to data
- BCombining multiple classes into one class
- CInheriting methods from other classes
- DAllowing objects to have multiple forms
Show answerHide answer
Answer: A
Encapsulation bundles data and methods and restricts direct access to the data.
Question 5
Unlike Java or C++ Python:
- AUses only public data
- BHas no strict private or protected keywords
- CCannot hide data at all
- DRequires keywords for access control
Show answerHide answer
Answer: B
Python relies on naming conventions instead of strict keywords.
More tests in Object Oriented Programming Using Python
Practise with a free account
Save your scores, see which chapters need work, and keep a notebook of every question you got wrong.