3.9k views
1 vote
Suppose that bClass is a class. Which of the following statements correctly derives the class dClass from bClass? a. class dClass:: protected bClass { //classMembersList }; b. class dClass:: public bClass { //classMembersList }; c. class bClass: public dClass { //classMembersList }; d. class dClass: private bClass { //classMembersList };

User Kim Kling
by
5.9k points

1 Answer

7 votes

Answer:

The answer to the given question is option "d".

Explanation:

In C++ programming language we use the (:) colon to perform inheritance in the class. The by default access modifier is used for inheritance that is "private". In the given options the option d is correct and other options are not correct that cab be described as:

  • In option, a, b we use the scope resolution operator (::) that is not used for inheritance.
  • In option, c we inherit drive class to base class that is not correct.

That's why the answer to this question is option "d".

User Gaurav Pathak
by
5.4k points