0
3-What is the difference between protected and private access specifiers in inheritance? a. private member is not inheritable an
3 odpowiedzi
0
private attributes and modules can't accessed outside of the class so they can't even be inherited. protected ones instead can only be accessed by subclasses (so they can be inherited)
in java if you live something that isn't nor private nor public nor protected, it will be no description that means that can be used only in the current package
0
Punam Mundada both are not public and can not be accessed outside class without public method...
now, concern is why two different options then... reason is that
it is having importance when you inherit...
if something is private, you can not access same directly in inherited class... for protected members, you can access them in inherited class..
0
Punam Mundada below thread might interest you :
https://www.sololearn.com/Discuss/1482338/?ref=app