How many access modifiers are in java ?
A. 3
B. 5
C. 4
D. 2
Answer: Option C
Solution (By Examveda Team)
Java provides a number of access modifiers to set access levels for classes, variables, methods, and constructors. The four access levels are −Visible to the package, the default. No modifiers are needed.
Visible to the class only (private).
Visible to the world (public).
Visible to the package and all subclasses (protected).
Join The Discussion