hamburger menu
All Coursesall course arrow
adda247
reward-icon
adda247
    arrow
    arrow
    arrow
    Which of the following statements about private members in a base class is correct?
    Question



    Which of the following statements about private members in a base class is correct?

    A.

    Private members of a base class are accessible directly by the derived class.

    B.

    Private members can be accessed directly by derived classes through object instances.

    C.

    Private members of a base class cannot be accessed by any derived class directly.

    D.

    Private members are inherited as public members in the derived class.

    E.

    None of the above

    Correct option is C

    The correct answer is (c) Private members of a base class cannot be accessed by any derived class directly. In object-oriented programming, private members are strictly accessible only within the base class itself.
    Important Key Points:
    1. Private Members: Members declared as private in a base class are not accessible directly by any derived class.
    2. To access private members, developers often use public or protected getter/setter methods defined in the base class.
    3. Protected Access Modifier: If members need to be accessible to derived classes, they should be declared as protected.
    Knowledge Booster:
    · Direct Access in Derived Classes: Derived classes cannot access private members of the base class directly. Only protected or public members are accessible.
    · Inheritance Rules:
    · Private Members are inherited but cannot be accessed directly.
    · Public and Protected Members are accessible based on their access specifiers.
    · Incorrect Statements:
    · Option (a): Incorrect because private members are not accessible directly by derived classes.
    · Option (b): Incorrect because private members cannot be accessed directly via object instances by derived classes.
    · Option (d): Incorrect because private members are not promoted to public members in derived classes.

    Free Tests

    Free
    Must Attempt
    Video Solutions

    RBI Assistant Pre 2026 Full Mock Test -01

    languageIcon English
    • pdpQsnIcon100 Questions
    • pdpsheetsIcon100 Marks
    • timerIcon60 Mins
    languageIcon English
    Free
    Must Attempt
    Video Solutions

    RBI Asst Prelims 2026 : Reasoning Section Test 01

    languageIcon English
    • pdpQsnIcon35 Questions
    • pdpsheetsIcon35 Marks
    • timerIcon20 Mins
    languageIcon English
    Free
    Must Attempt
    Video Solutions

    RBI Office Attendant 2026 Full Mock Test - 01

    languageIcon English
    • pdpQsnIcon120 Questions
    • pdpsheetsIcon120 Marks
    • timerIcon90 Mins
    languageIcon English
    test-prime-package

    Access ‘IBPS SO IT Officer’ Mock Tests with

    • 60000+ Mocks and Previous Year Papers
    • Unlimited Re-Attempts
    • Personalised Report Card
    • 500% Refund on Final Selection
    • Largest Community
    students-icon
    354k+ students have already unlocked exclusive benefits with Test Prime!
    Our Plans
    Monthsup-arrow