Question: 1. what is the difference between public private and protected modifiers?
Answer: public : accessible from everywhere. protected : accessible by the classes of the same package and the subclasses residing in any package. default (no modifier specified): accessible by the classes of the same package. private : accessible within the same class only.