Java access modifiers:default, public, privateand protected

Java access modifiers:default, public, privateand protected.

1. default access modifier:here variables and methodsare accessible with in samepakage and not in other pakages

2. public access modifier:variables and methods are acce-ssible in same & other pakages

3. private access modifier:does not allow accessoutside to class or file

4. protected access modifier:here same pakage accessis allowed and other pakageaccess is allowed throughsubclass by extending theclass having protectedvariables and methods

#shorts#javaaccessmodifiers#access#modifiers#default#public#private#protected