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
Math,
8 months ago
India Languages,
8 months ago
Accountancy,
8 months ago
Math,
1 year ago
English,
1 year ago