Question

A software developer is designing a banking application where each bank account object should restrict direct access to its balance variable to prevent accidental modifications. Instead, the application allows access to the balance only through specific methods like getBalance() and deposit(), which include validation checks to ensure that operations are secure and valid. Which object-oriented programming principle is the developer applying to achieve this data protection? 

A Abstraction
B Encapsulation
C Inheritance
D Polymorphism
E Aggregation
Practice Next

Relevant for Exams:

Hey! Ask a query