Package Public Class Int Private Int Public Int Protected Static Int Public Static Void
Package Public Class Int Private Int Public Int Protected Static Int Public Static Void
Access specifiers are use to represent scope of members of class. In java Access specifiers
are classified into 4 types/ access modifier/ access provider/visibility labels
1. private
2. default
3. protected
4. public
1. private: If you declare any member of class as private then scope of that member
remains only within the class. It can't be access from other classes.
2. default: If you declare any member of class as default then scope of that member
remains only within the package. It can't be access from other packages.
Note: There is no keyword to represent default access specifier. By default java classes
access specifires will be default until we make it public, private, protected
3. protected: If you declare any member of class as protected then scope of that member
remains only within the package, that class which is present outside the package can
access it by one condition ie. inheritance operation.
4. public: If you declare any member of class as public then scope of that member remains
throught the project.
package Access_modifier;
package Access_modifier;
}
package constructor_study;
import Access_modifier.Private_use;
public class Accses_use extends Private_use
{// created class in another package
}
}