Question: what is the difference between private protected and public?
Answer: A public member is accessible from anywhere outside the class but within a program. ... A protected member variable or function is very similar to a private member but it provided one additional benefit that they can be accessed in child classes which are called derived classes.