Encapsulation:
- Data encapsulation is used to hide the implementation details from users.
- If a data member is private it means it can only be accessed within the same class.
- No outside class can access private data member (variable) of other class.
Syntax:
Example program:
No comments:
Post a Comment