Difference between AccessSpecifiers and AccessModifiers

  • Java has only AccessModifiers
  • Threre are no AccessSpecifiers in java

There are 12 AccessModifiers in java

public static native
private final transient
protected abstract volatile
<default> synchronized strictfp

Proof:

Just create the Basic Example Lets say:

private class Test{
public static void main(String[] args){
   System.out.println("Proof");
   }
}


Test.java:1: error: modifier private not allowed here
private class Test{
^
1 error


 

So From the above example we can clearly say that, Java has no AccessSpecifiers

 

 

Advertisements