English

The access specifier that is applicable in case of inheritance is:

Advertisements
Advertisements

Question

The access specifier that is applicable in case of inheritance is:

Options

  • default

  • private

  • public

  • protected

MCQ
Advertisements

Solution

protected

Explanation:

The protected modifier allows class variables and methods to be hidden from the general public while remaining fully visible and accessible to any subclass (child class) that inherits from it, even if that subclass resides in a completely different package.

shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Encapsulation - Exercises [Page 148]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 6 Encapsulation
Exercises | Q 1. (v) | Page 148
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×