Computer Science, asked by Anonymous, 2 months ago

Explain the various type of access modifiers. ​

Answers

Answered by OoINTROVERToO
1

There are four types of access modifiers:

  • PRIVATEVisible to a particular class
  • PUBLIC Visible to the world
  • ProtectedVisible to specific package as well as subclass
Answered by Abhisheklasur
0

Private: The access level of a private modifier is only within the class. It cannot be accessed from outside the class. Default: The access level of a default modifier is only within the package. ... Protected: The access level of a protected modifier is within the package and outside the package through child class.

Similar questions