Advertisements
Advertisements
प्रश्न
During inheritance if no visibility mode is declared then the system automatically assumes it to be private.
विकल्प
True
False
MCQ
सत्य या असत्य
उत्तर
This statement is False.
Explanation:
- In inheritance (particularly in C++), the default visibility mode is:
- Private for class inheritance.
- Public for struct inheritance.
- 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
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?