English

During inheritance if no visibility mode is declared then the system automatically assumes it to be private. - Computer Applications

Advertisements
Advertisements

Question

During inheritance if no visibility mode is declared then the system automatically assumes it to be private.

Options

  • True

  • False

MCQ
True or False

Solution

This statement is False.

Explanation:

  1. In inheritance (particularly in C++), the default visibility mode is:
    1. Private for class inheritance.
    2. Public for struct inheritance.
  2. However, in Java, no visibility modes such as private, public, or protected are provided during inheritance. The default access behaviour is determined by the class members' access modifiers. In Java, inheritance works by inheriting both public and protected elements. 
shaalaa.com
  Is there an error in this question or solution?
Chapter 8: Encapsulation and Inheritance - EXERCISES [Page 444]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 8 Encapsulation and Inheritance
EXERCISES | Q III. 5. | Page 444
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×