What are the four access modifiers Java offers?
private | default | protected | public
What does private modifier means?
Methods/Fields can be called only from within the same class.
What does default modifier means?
When there is no access modifier defined, the Methods/Fields can be called only from same class and classes in the same package.
🤯️ This one is tricky because there is no keyword for default access.
What does protected modifier means?
Methods/Fields can be called only from within the same class/package and sub-classes.
What does public modifier means?
Methods/Fields can be called from any class. (same class/package, sub-classes and any package regardless)