93.9k views
0 votes
Which mechanism in OOP is implemented by making instance variables private and providing accessor and mutator methods in a class

1 Answer

2 votes

Answer:

Encapsulation is implemented through making variables private and providing accessor and mutator methods in a class. Encapsulation is one of four pillars of OOP other three are Inheritance, Polymorphism and Abstraction.

Step-by-step explanation:

Encapsulation provides data hiding through making variables private and providing access through getter and setter or accessor and mutator in a class.

User Warpech
by
6.8k points