What is an access modifier | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

What is an access modifier

definition and examples

15th Aug 2018, 9:48 AM
Ifeanyi
Ifeanyi - avatar
3 Answers
+ 5
15th Aug 2018, 10:05 AM
Sudarshan Rai
Sudarshan Rai - avatar
+ 4
Access modifier gives us a specifies accessibility: 1. public - is accessible everywhere. 2. private - is accessible only within class. 3. protected - is accessible within package and outside the package but through inheritance only. 4. Default - If you don't use any modifier and the default modifier is accessible only within package.
15th Aug 2018, 10:04 AM
Przemek Drozd
Przemek Drozd - avatar
+ 3
Przemek Drozd thank you even I known about default is an access specifier
15th Aug 2018, 4:21 PM
Yesh Jadav
Yesh Jadav - avatar