First of all, let me say one thing: in java there is no such term as "Access Specifier". We should call everything "modifiers." Since we know that final, static, synchronized, volatile .... are called modifiers, even Public, private, protected, default, abstract should also be called modifiers. By default, these are modifiers where there is no physical existence, but modifiers are not placed, so it should be considered as default modifiers.
To justify this, take one example:
public class Simple{ public static void main(String args[]){ System.out.println("Hello Java"); } }
The output will be: Hello Java
Now change the public to private and see what compiler error you get: It says: “The private modifier is not allowed here” What is the conclusion: someone may be wrong, or some tutorial may be wrong, but the compiler cannot be wrong. Thus, we can say that the terminal access specifier in java is not a modifier.
Sagar Raut Aug 22 '17 at 8:03 on 2017-08-22 08:03
source share