A fundamental concept in object-oriented programming (OOP) that involves bundling data (attributes) and methods (functions) that operate on the data into a single unit or class. It also involves restricting direct access to some of the object’s components, which is a means of preventing accidental interference and misuse of the data.
The main idea is to control the access to the data by exposing only necessary methods (often called getters and setters) to interact with the data while keeping the actual data (attributes) private.