+ 3
Any help plz????
what are the diffrances between ...public,protected andprivate
5 odpowiedzi
+ 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*/
+ 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...
+ 1
Public = para llamar desde cualquier clase.
Private = solo se llama dentro de la clase.
Protected = es igual que el public pero protegido
+ 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