Get Answers to all your Questions

header-bg qa

What is the difference between protected and private members of a class?

Answers (1)

best_answer

Private visibility: A member which is declared as private and can be accessed only in class. It cannot be accessed outside the class.
Protected visibility: A member that can be accessed inside the class as well as inside its sub-class only.

Posted by

Deependra Verma

View full answer