Any help plz???? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Any help plz????

what are the diffrances between ...public,protected andprivate

9th Feb 2018, 12:18 PM
Wafaa Hendy
Wafaa Hendy - avatar
4 Answers
+ 17
U will find a good table in comment section of the lesson to explain the differenece between these "access modifiers" /* U can make codes , using these access modifiers & see when error comes & understand better*/
9th Feb 2018, 12:22 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 4
imagine your printer in your home(bare with me) if you set it to be accessible for any one on network , you have made it "public" if you make it accessible only for people who are in your house , you have made it "protected " and finally if you make it accessible only for you , and you only , you have made it ........ you guessed it! "private" same idea goes for methods classes , variables...
10th Feb 2018, 7:18 PM
Farshaad Heydari
Farshaad Heydari - avatar
+ 1
Public = para llamar desde cualquier clase. Private = solo se llama dentro de la clase. Protected = es igual que el public pero protegido
14th Feb 2018, 12:41 AM
Hugo Roca
Hugo Roca - avatar
+ 1
Suppose there is computer in any cyber cafe.then that computer is accessed by anyone in that area so it is public.. But if that computer is in school..then that can be accessed by the student and teacher of that school only so it is protected.. But our personal computer at home which is accesed only by me is private
24th Jun 2019, 3:18 PM
anuradha mall