What is the difference between access specifiers and access modifiers?
Java has basically 2 types of Modifiers:
- java access modifiers
- java non-access modifiers
Java access modifiers and Java access specifiers are the same thing, which are public
, private
, protected
.
Referring to the Sun Java Docs they both seem to be the same:
Access Modifier
- Search for
access specifier
on this page.
The term Access specifier used by c++ programmers not in java. In java Officially we use Access Modifier.
For example: when we declare a class with private, static the compiler clearly shows the error message as follows:
"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.