137k views
5 votes
A derived class has access to __________.

a. the public functions and variables of its ancestor classes.
b. the private functions and variables of its ancestor classes.
c. only the functions and variables defined it its class.
d. none of the above.

User IAmDranged
by
5.7k points

1 Answer

2 votes

Answer:

Option a is the correct answer for the above question

Step-by-step explanation:

The derived class is a class that inherits the property of the base class, and he can access the public variable and function or members of the base class or ancestor class.

Option 'a' also states the same and the question asked about the assessment of the derived class. Hence option a is the correct answer while the other is not because:-

  • Option b states about the private members, but it is not accessible by the derived class.
  • Option c states about the derived class members but it can also access the base class members.
  • Option d none of the above, but option a is the correct answer.

User Justin Meltzer
by
5.7k points