Java provides various access modifiers to variable method and constructor.
private package public protected
If we don't use any of these it will be package by default.
A class can be public or package not private or protected because no other class can access the class.
Access modifiers can't be used against block.
Top comments (0)