What is the difference between access specifiers and access modifiers in java?



What is the difference between access specifiers and access modifiers in java?..

Answer / Reeta Joshi

"Access specifiers in Java determine the visibility of a class, method or variable within the program. There are four access specifiers: public (visible everywhere), protected (visible within the package and subclasses outside the package), default (visible only within the same package), and private (visible only within the same class). Access modifiers, on the other hand, determine the level of access for variables and methods within a class. In Java, there are three access modifiers: public, protected, and private."n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What are checked exceptions?

1 Answers  


What are the major drawbacks of external iteration?

1 Answers  


How are this() and super() used with constructors in java programming?

1 Answers  


What must a class do to implement an interface in java programming?

1 Answers  


What about instanceof operator in java?

1 Answers  


Is minecraft java edition free?

1 Answers  


Why is java so important?

1 Answers  


What are mutable classes?

1 Answers  


How many types of memory areas are allocated by JVM in java?

1 Answers   UGC Corporation,


What are recursive functions?

1 Answers  


What is the significance of java packages?

1 Answers  


What is finally block?

1 Answers  


Categories