Zensar Technologies Interview Question

Name OOP and what is encapsulation

Interview Answer

Anonymous

Sep 6, 2024

Encapsulation is one of the core principles of OOP. It refers to the concept of bundling data (attributes) and methods (functions) that operate on the data into a single unit or class. Moreover, encapsulation also involves restricting access to certain components of an object and only exposing the necessary parts. This is typically achieved using access modifiers like private, protected, and public