In Java, are access specifiers and access modifiers the same thing?
There are no differences between the specifiers and modifiers, and the use of both is the same. The access modifier is an official term and the new term that we use instead of modifier is specifier.
Java provides four types of access modifiers or visibility specifiers i.e. default, public, private, and protected.
In C++, there are three access specifiers: public - members are accessible from outside the class. private - members cannot be accessed (or viewed) from outside the class. protected - members cannot be accessed from outside the class, however, they can be accessed in inherited classes.
"access modifier" is the official term for private
, protected
and public
used in the Java language specification. "access specifier" is used synonymously in the Java API doc, but this is the first time I've noticed that. It's probably better to stick with the JLS term.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With