Ques. What are the three levels of method access control for classes and what do they signify? What do they imply about the method?
Public, protected, and private.
Public methods can be called by all objects and subclasses of the class in which they are defined in.
Protected methods are only accessible to objects within the same class.
Private methods are only accessible within the same instance.
- Be able to explain why this does (or doesn’t matter), and when you would want to set a method as private.