I know that encapsulation means something like that one object should not have direct access to members of different objects...but I guess it relates to public fields? I assume public methods do not break encapsulation..? I am just not clear here and would be glad for any explanation.
Encapsulation is that you drive your car by:
and not by:
Expose (make public
) WHAT and hide (make private
) HOW. Now, you're encapsulating.
:)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With