Explain the various type of access modifiers.
Answers
Answered by
1
There are four types of access modifiers:
- PRIVATE → Visible to a particular class
- PUBLIC → Visible to the world
- Protected → Visible to specific package as well as subclass
Answered by
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