English

Differentiate between private and protected visibility modifiers. - Computer Applications

Advertisements
Advertisements

Question

Differentiate between private and protected visibility modifiers.

Distinguish Between

Solution

S. No. Private Protected
1. Private members are only visible within the class where they were defined. Protected members are visible to classes within the same package and to subclasses (including those from other packages).
2. Private elements are not shared with other classes during inheritance.  Protected elements can be applied to derived classes during inheritance.
shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Class as the Basis of all Computation (Objects and Classes) - Review Insight [Page 380]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 6 Class as the Basis of all Computation (Objects and Classes)
Review Insight | Q 2. | Page 380
Avichal Computer Applications [English] Class 10 ICSE
Chapter 6 Class as the Basis of all Computation (Objects and Classes)
EXERCISES | Q V. 6. | Page 384
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×
Our website is made possible by ad-free subscriptions or displaying online advertisements to our visitors.
If you don't like ads you can support us by buying an ad-free subscription or please consider supporting us by disabling your ad blocker. Thank you.