What are the features of encapsulation?
Answers
Answered by
2
Answer:
In encapsulation, the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class. Therefore, it is also known as data hiding. Declare the variables of a class as private. Provide public setter and getter methods to modify and view the variables values.
Similar questions
Political Science,
4 months ago
English,
4 months ago
Social Sciences,
4 months ago
Hindi,
8 months ago
Accountancy,
8 months ago
English,
1 year ago