Examveda

When a class is derived from another derived class, the newly derived class

A. may have more liberal access to a base class member than its immediate predecessor

B. may have the same type of access to a base class member as its immediate predecessor

C. may have more limited access to a base class member than its immediate predecessor

D. both (b) and (c)

Answer: Option C


Join The Discussion

Comments (1)

  1. Arvind Maurya
    Arvind Maurya:
    2 years ago

    When a class is derived from another derived class, the newly derived class:

    D. both (b) and (c)

    Explanation:

    In C++, the access level to base class members is determined by the access specifiers (public, protected, private) used in inheritance and by the access control within the base class itself. The derived class can have:

    The same type of access to base class members as its immediate predecessor if the inheritance access specifier does not restrict access further.
    More limited access to base class members than its immediate predecessor if the inheritance access specifier or the base class member access specifier imposes more restrictions.

Related Questions on Object Oriented Programming Using C Plus Plus

A default catch block catches

A. all thrown objects

B. no thrown objects

C. any thrown object that has not been caught by an earlier catch block

D. all thrown objects that have been caught by an earlier catch block