Answer Posted / javamasque
Public: It is the highest visibility access modifier. It makes visible the class members (variables/methods) to any classes (child/non-child) present within same or any package.
Protected: It has lesser visibility than public access modifier. It makes visible the class members (variables/methods) to sub-classes within same or different package and it also make visible in any class of same package.
Default: It has lesser visibility than protected access modifier. It makes visible the class members (variables/methods) to any classes within same package only.
Private: It has least visibility than all access modifiers. It makes visible the class members (variables/methods) within same class only.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What do you mean by thread safe?
What is an array length?
How do you replace a string in java?
What are the different types of methodologies?
What is the difference between synchronized and synchronized block?
Difference between default and protected access specifiers?
What are the benefits of immutable objects?
What state is a thread in when it is executing?
What is use of functional interface in java 8? Explain
What are streams?
List down the methods and interfaces of collection class in java.
Which collection is ordered in java?
what are different ways in which a thread can enter the waiting state? : Java thread
What is math floor in java?
What is a flag value?