What is class how does it accomplish data hiding in java?
Answers
Answered by
5
A class is a template or a
model with which objects can be created. Any method or variable declared
private can be accessed only within the class. They cannot be accessed
externally. In other words, the private variables and data are hidden or
encapsulated from outside the class.
This makes programming easy because the code written outside the class does not mess with the code that defines the class.
This makes programming easy because the code written outside the class does not mess with the code that defines the class.
Similar questions
Hindi,
8 months ago
Science,
8 months ago
Political Science,
8 months ago
Math,
1 year ago
English,
1 year ago