What is a class? How does it accomplish data hiding? Explain with the help of an
example
Answers
Answered by
0
Answer:
Data hiding ensures exclusive data access to class members and protects object integrity by preventing unintended or intended changes. The best example of Data Hiding would be String. Now String in Java is a class but we treat it as a datatype.
Similar questions