15.4k views
2 votes
Which OOPS concept exposes only the necessary information to the calling functions?

a. Inheritance
b. Polymorphism
c. Encapsulation
d. Abstraction

User Laquandra
by
8.2k points

1 Answer

4 votes

Final answer:

Encapsulation is the OOPS concept that exposes only necessary information to calling functions, providing a protective barrier that prevents the data from being accessed directly from outside the object.

Step-by-step explanation:

The OOPS concept that exposes only necessary information to the calling functions is encapsulation. Encapsulation is a fundamental concept in object-oriented programming that combines the data and the functions that manipulate that data into a single unit called an object. Moreover, encapsulation protects the object's internal state from being accessed directly by the outside world. Functions within the object can access the data, whereas outside functions access the data through the methods exposed by the object. Hence, it serves to hide the internal representation or state of an object and only allows modifications through a well-defined interface.

User Ryan Gray
by
8.1k points