Access control u Controlling how the member functions and data members could be accessed Public- could be accessed outside the class Protected-could only be accessed by those classes deriving from it, or by friend classes and functions Private- could only be accessed inner this class or by friend classes and functions Suggestion: Avoid exposing the data members in the public interface, Use accessing functions insteadAccess control ◼ Controlling how the member functions and data members could be accessed ◼ Public – could be accessed outside the class ◼ Protected – could only be accessed by those classes deriving from it, or by friend classes and functions ◼ Private – could only be accessed inner this class, or by friend classes and functions ◼ Suggestion: Avoid exposing the data members in the public interface, Use accessing functions instead