Private members can only be accessed by objects of the class in which the private object is defined.
Protected members can also be accessed by objects of classes that are a sub class in which the object is defined.
Private members can only be accessed by objects of the class in which the private object is defined.
Protected members can also be accessed by objects of classes that are a sub class in which the object is defined.
Comment