Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

what is encapsulation in oop? the process of exposing all data and meth…

Question

what is encapsulation in oop?
the process of exposing all data and methods of a class.
the ability of an object to access data from other objects.
the practice of hiding internal data and methods within a class and providing controlled access.
the process of converting data from one type to another.
question 8
1 pts
what is the purpose of using private attributes in encapsulation?
to make the code more complex.
to prevent direct access to attributes from outside the class.
to improve the performance of the code.
to allow unlimited access to attributes.

Explanation:

Brief Explanations

For the first question, encapsulation in OOP is a core principle focused on hiding internal class details and enabling controlled access. For the second question, private attributes restrict direct external access to protect data integrity.

Answer:

The practice of hiding internal data and methods within a class and providing controlled access.
To prevent direct access to attributes from outside the class.