Private: When the class members are defined under a private specifier, then it is accessible only inside the class. The programmer is not allowed to use outside the class.
Public: When defined in public, then it is accessible anywhere in the complete program. The programmer can call the member from anywhere with the help of an object of the class. In simple words, you can say it is globally accessible in the program.
Protected: The protected member of the parent class is accessible only in the child classes.