ACCESS SPECIFIERS Vs ACCESS MODIFIERS

Summary of Access Specifiers v/s. Access Modifiers.

Access Specifiers

Access Modifiers

The access specifier determines how accessible the field is to code in other classes.You can optionally declare a field with an access specifier keyword: public, private, or protected.

You can optionally declare a field with a modifier keyword: final or volatile and/or static and/or transient.

Access Specifer are used to specifiy how the member variable, methods or class to other classes.They are public, private and protected.

Access Modifier:   1. Access   2. Non Access
Access: public, private, protected and default.
Non Access: abstract, final, native, static, synchronized, transient, volatile and strictfp

They are used to set the visibility of a class or variable or a method. Classes can be Public or Default.Variables and methods can be public, private, protected or default

They are used to optionally declare a field.That is we can set access modifiers for class, method or variables. Classes can have modifier like Abstract. Methods can have abstract, native, synchronised etc.

 

Access specifier:an access specifier allows the user to control the access of classes, methods and fields.

Access modifier: an access modifier specifies the visibility ofclasses,methods and fields.