Question: what is the difference between public protected and private in a class definition?
Answer: What is the difference between public, protected and private in a class definition? ... private - Only the current class will have access to the field or method. protected - Only the current class and subclasses (and sometimes also same-package classes) of this class will have access to the field or method.