What are the different access modifiers available in java?



What are the different access modifiers available in java?..

Answer / Ayushi Srivastava

The different access modifiers available in Java are:
1. public: accessible from any class, package or outside the package
2. protected: accessible within its own package and subclasses of other packages
3. (no modifier): accessible only within the same class
4. private: accessible only within the same class

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Which is bigger float or double?

1 Answers  


Explain different states of a thread in java?

1 Answers  


can we access the method of class without creating the object of the class

3 Answers  


List implementations of list interface?

1 Answers  


What initialize variables?

1 Answers  


Can arraylist contain null values?

1 Answers  


What is the default size of arraylist in java?

1 Answers  


Why java is considered as platform independent?

1 Answers  


What are abstract methods in java?

1 Answers  


why we write public static void main (String args[]) in core java plz explain briefly??????????????????

3 Answers   HCL,


How many bits are allocated to represent character of character sets - Unicode, ASCII, UTF-16, UTF-8?

1 Answers  


What function extracts specified characters from a string?

1 Answers  


Categories