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 |
How to create an interface?
What is a constructor, constructor overloading in java?
State the difference between strings and arrays.
what are the methods of an object class?
What is adapter class?
my method "abc" return array of interface "xyz" and "pqr" is abstract class implements abc and class "jkl" extends pqr My problem 1) when i call abc it retrun array xyz how can i do this hint xyz refer_xyz = new jkl(); but i can't create array. 2)I want to access method of jkl using reference of xyz??
How do you use compareto in java?
difference between vectorlist and hash
What is the difference between static method and instance method in Java?
0 Answers SwanSoft Technologies,
Is hashset ordered java?
What is the use of volatile in java?
Can you call one constructor from another if a class has multiple constructors?