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
Which number is denoted by leading 0x or 0x in java?
What is a finally block?
what invokes a threads run() method? : Java thread
Can you tell me range of byte?
What is square root in java?
What are the different collection views provided by maps?
What is r in java?
What is regex used for?
What is lossy conversion in java?
What is the purpose of declaring a variable as final?
What are the differences between path and classpath variables?
Can a class be defined inside an interface?
What is the benefit of inner / nested classes ?
What is an object in java and how is it created?
What package is math in java?