177k views
3 votes
Instance variables are declared private to prevent direct modification. Access to the variables is instead provided through methods. This practice is known as..

a. dereferencing
b. convention
c. encapsulation
d. instantiation

please help and thank you so much
EDIT: The answer is c.

User Chantee
by
7.0k points

1 Answer

1 vote
Instance variables are declared private to prevent direct modification. Access to the variables is instead provided through methods. This practice is known as..
c. encapsulation. It is a mechanism of bundling the data (variables) and code acting on the data (methods) together as one.
User Keith Miller
by
8.6k points