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
Why is method overloading not possible by changing the return type in java?
What is integer valueof?
Why do we declare a class static?
Can we change the value of static variable?
What is sorting in java?
What is the use of coding?
Why destructor is not used in java?
Can we create a class inside a class in java?
Does list maintain insertion order java?
What is the disadvantage of java?
What do you understand by the term string pool?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?
What does %d do in java?
How to invoke external process in java.
What 5 doubled?