How does access modifiers work?
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 |
what is the purpose of the final in the try-catch-final
what is ennumaration?
Is java a software?
What is deadlock and how to avoid this?
When should I use singleton pattern?
What is return in java?
How many bits does a boolean take?
Differentiate Vector and ArrayList?
what is actual real time using of oops concepts in projects(Interface,polymorphism.abstraction.........)
Can a class extend more than one class?
What is a null check?
How to count occurrences of each duplicate element in a list {a,b,d,c,a,b} ? Thanks in Advance