The following snippet represents one of the OOP pillars Which one is that?
A.
Serialization
B.
Inheritance
C.
Encapsulation
D.
Polymorphism
The Answer Is:
C
This question includes an explanation.
Explanation:
The given code snippet demonstrates the concept of encapsulation in object-oriented programming. Encapsulation refers to the practice of keeping the internal state and behavior of an object hidden from the outside world and providing a public interface for interacting with the object. In the given code snippet, the __init__ and get_balance methods provide a public interface for interacting with instances of the BankAccount class, while the __balance attribute is kept hidden from the outside world by using a double underscore prefix.
PCPP-32-101 PDF/Engine
Printable Format
Value of Money
100% Pass Assurance
Verified Answers
Researched by Industry Experts
Based on Real Exams Scenarios
100% Real Questions
Get 75% Discount on All Products,
Use Coupon: "ac75sure"