Forums Register Login

Why we can't declare private and protected as access specifiers for a class

+Pie Number of slices to send: Send
Why we can't use private and protected as access specifiers for a class.
Could you give me an example.
+Pie Number of slices to send: Send
Because you can't. Why can't a variable be declared as both "int" and "double?" Same reason: because it can't.

Please don't start new threads to ask follow-on questions from other threads -- we already discussed this here. I'm going to close this thread; followups in the original thread, please.
If you look closely at this tiny ad, you will see five bicycles and a naked woman:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


Reply locked
This thread has been viewed 967 times.
Similar Threads
Accessibility Modifiers for classes
about access specifiers
enum public/protected/default/private
Inner classes and inheritance
Use of Protected access specifier in real-life application
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:01:27.