Infosys Interview Question

Q what is encapsulation ?

Interview Answer

Anonymous

Feb 21, 2024

Encapsulation is a fundamental principle in object-oriented programming (OOP) where data and methods that operate on the data are bundled together within a class, and the class controls access to them. This helps in keeping the internal state of an object safe from outside interference and misuse, promoting modularity, and reducing system complexity