What is the use of protected access specifier in Java.
Protected isn't used ask that often. It means that the value that it specifies can only be modified (or the function that it specifies can only be accessed) within the class or by any derived classes.
@Viarj parotected can only... public can also...
Same goes for public, data members and methods declared public can also be modified and accessed within the class or derived class so what's the diffrence?