Step 1: Understanding data protection in Object-Oriented Programming.
Object-Oriented Programming (OOP) is based on several important principles such as encapsulation, abstraction, inheritance, and polymorphism. These principles help developers design secure, reusable, and maintainable programs.
Step 2: Meaning of Encapsulation.
Encapsulation is the process of combining data and the methods that operate on that data into a single unit called a class. It also restricts direct access to certain components of the object, which helps protect the internal data of the object.
Through encapsulation, sensitive data is hidden from outside access and can only be modified through controlled methods. This concept is also known as data hiding.
Step 3: Evaluation of options.
(A) Abstraction: Incorrect. Abstraction hides implementation details but does not primarily focus on protecting data from outside access.
(B) Encapsulation: Correct. It protects object data by restricting direct access and exposing it only through methods.
(C) Polymorphism: Incorrect. Polymorphism allows methods to behave differently depending on the object.
(D) Inheritance: Incorrect. Inheritance allows a class to inherit properties and behaviors from another class.
Step 4: Conclusion.
Thus, the concept that protects data by making it inaccessible from outside the class is Encapsulation.
Final Answer: Encapsulation