Forums Register Login

Protected and Private

+Pie Number of slices to send: Send
What is the difference between protected and private? Can you read the values of a protected class variable, but not write to it? Or am i completely off track.
+Pie Number of slices to send: Send
Hi Conrad,
Protected: Can be seen (and used) by the class and any subclasses.
Private: Can only be seen by the class.
The accessor modifiers apply the restrictions to reading and writing. Either you see it and can do anything or you don't and can't!
Regards,
Manfred.
+Pie Number of slices to send: Send
Well thankee kindly! I'll just mosey on back to work!
Not looking good. I think this might be the end. Wait! Is that a tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 848 times.
Similar Threads
access control modifier for enum
Interfaces
How come public and friendly(default) access is allowed for top level class but not
Can a top level class be private ?
difference between protected and private
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:48:48.