PRACTICE • LEARN • GROW
Module 3 Final Quiz: Encapsulation and Abstraction MCQs
Solve topic-wise placement questions and improve your skills.
Module 3 Final Quiz: Encapsulation and Abstraction Progress
0 of 11 completed
0%
Topic Track
You are viewing MCQs in preview mode. Log in to select options, submit answers, and track your progress.
Log In to Answer
1
What is the core distinction between Encapsulation and Abstraction?
A.
Encapsulation hides complexity; Abstraction hides data
B.
Encapsulation hides internal data/state via access modifiers; Abstraction hides implementation complexity by exposing only essential interfaces
C.
Encapsulation is achieved with interfaces; Abstraction is achieved with getters
D.
They are completely identical concepts with different names
Explanation & Key
Correct Answer:
2
Why should instance fields be declared private and exposed through public getters and setters?
A.
Because private fields consume less RAM than public fields
B.
To validate incoming input values, maintain invariants, and allow internal refactoring without breaking callers
C.
To force the program to run in single-threaded mode
D.
It is required by the hardware CPU
Explanation & Key
Correct Answer:
3
Which of the following is a classic real-world analogy for Abstraction?
A.
A driver using the steering wheel and brake pedal without knowing engine mechanics
B.
A locked safe containing money that nobody can open
C.
A clone of an animal
D.
A printed book page
Explanation & Key
Correct Answer:
4
How is Abstraction primarily implemented in Java and C++?
A.
Global variables and macros
B.
Abstract classes and Interfaces (pure virtual classes in C++)
C.
Goto statements and switch cases
D.
Binary serialization
Explanation & Key
Correct Answer:
5
If a class has all private fields and only getter methods (no setters), what property does the resulting object possess?
A.
Polymorphism
B.
Immutability
C.
Multiple inheritance
D.
Dynamic binding
Explanation & Key
Correct Answer:
6
What term describes packaging attributes and methods together into a protective 'capsule'?
A.
Decomposition
B.
Encapsulation
C.
Coupling
D.
Normalization
Explanation & Key
Correct Answer:
7
Which software design metric is improved by proper Encapsulation?
A.
Tighter coupling and lower cohesion
B.
Loose coupling between modules and high cohesion within each class
C.
Larger binary executable size
D.
Higher memory latency
Explanation & Key
Correct Answer:
8
Can an abstract class be instantiated directly using the 'new' operator?
A.
Yes, always
B.
No, abstract classes cannot be directly instantiated
C.
Yes, but only if it contains zero abstract methods
D.
Only in debug mode
Explanation & Key
Correct Answer:
9
In the diagram of Encapsulation, how do outside client components communicate with private data?
A.
Direct memory pointer arithmetic
B.
Exclusively by invoking public member methods
C.
Through global interrupt handlers
D.
Via SQL queries
Explanation & Key
Correct Answer:
10
What is 'information hiding' in modular software engineering?
A.
Encrypting hard drive files at rest
B.
Hiding internal implementation details from other modules to prevent tight dependencies
C.
Obfuscating source code before distribution
D.
Deleting unused source files
Explanation & Key
Correct Answer:
11
Which of the following demonstrates a violation of Encapsulation?
A.
Declaring fields as public: 'public double accountBalance;'
B.
Providing a getter method: 'public double getBalance()'
C.
Validating inputs inside a setter method
D.
Using an interface to declare methods
Explanation & Key
Correct Answer:
Question Palette
Answered
Current
Not Attempted
Wrong