Encapsulation is more than hiding data though. Encapsulation means hiding implementation details, data being one of them. Private methods are one example; they are implementation details, therefore should not be exposed. Ideally code should only depend on interface/contracts.
Encapsulation is more than hiding data though. Encapsulation means hiding implementation details, data being one of them. Private methods are one example; they are implementation details, therefore should not be exposed. Ideally code should only depend on interface/contracts.
Agreed. Thank you for your feedback. I made the necessary clarifications.