What is the difference between private and protected access modifiers?

Feature Private Protected
Scope Only within the class. Within the class and its subclasses.
Inheritance Not accessible in child classes. Accessible in child classes.
Use case Data encapsulation. Allows controlled access in subclasses.