What are the different access modifiers available in Java?

1 answers

There are four types of Access modifiers:

  • Public – accessible from everywhere in the application
  • Protected – accessible within the package and the subclasses in any package
  • Package Private (Default) – accessible strictly within the package
  • Private – accessible only within the same class where it is declared
shilpigupta22 shilpigupta22 [Author] 6 months ago votes 0