English

Suppose, 'Happening' and 'Accident' are two classes. What will happen when Happening class derives from Accident class by using private visibility? - Computer Applications

Advertisements
Advertisements

Question

Suppose, 'Happening' and 'Accident' are two classes. What will happen when Happening class derives from Accident class by using private visibility? 

Short Answer

Solution

  1. The derived class (Happening) can use public members from the base class (Accident).
  2. The derived class (Happening) can use protected members from the base class (Accident).
  3. Private members from the base (Accident) class cannot be utilized in the derived class (Happening). 
shaalaa.com
  Is there an error in this question or solution?
Chapter 8: Encapsulation and Inheritance - EXERCISES [Page 446]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 8 Encapsulation and Inheritance
EXERCISES | Q V. 14. | Page 446
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×