Explain the various type of access modifiers
Answers
Answered by
6
Answer:
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
3
Answer:
Java provides four types of access modifiers or visibility specifiers i.e. default, public, private, and protected. The default modifier does not have any keyword associated with it. When a class or method or variable does not have an access specifier associated with it, we assume it is having default access.
Similar questions