English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

What is the difference between the members present in the private visibility mode and the members present in the public visibility mode? - Computer Science

Advertisements
Advertisements

Question

What is the difference between the members present in the private visibility mode and the members present in the public visibility mode?

Distinguish Between

Solution

Members present in the private visibility mode:

  • Can be accessed only by the class members.
  • By default, the members will be in private visibility mode.
  • When classes are inherited, private members are not inherited.

Members present in the public visibility mode:

  • Can be accessed by outside members also.
  • Members, to be in public visibility mode have to be specified explicitly.
  • When classes are inherited, the public members are inherited as private, protected, and public members of the derived class.
shaalaa.com
Visibility Modes
  Is there an error in this question or solution?
Chapter 16: Inheritance - Evaluation - Section - C [Page 273]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 11 TN Board
Chapter 16 Inheritance
Evaluation - Section - C | Q 2. | Page 273
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×