class professor {};
class teacher : public virtual professor {};
class researcher : public virtual professor {};
class myprofessor : public teacher, public researcher {};
Referring to the sample code above, if an object of class
"myprofessor" were created, how many instances of professor
will it contain?
a) 0
b) 1
c) 2
d) 3
e) 4
Answer Posted / ahsanullah
becouse of virtual keyword it will create only one instances,
so ANS is: 1
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is exception handling? Does c++ support exception handling?
What is time_t c++?
What is a tuple c++?
Define a nested class. Explain how it can be useful.
How the programmer of a class should decide whether to declare member function or a friend function?
How does atoi function work?
Describe public access specifiers?
What is polymorphism in c++? Explain with an example?
How did c++ get its name?
Explain rethrowing exceptions with an example?
What is the full form of india?
Explain how would you handle a situation where you cannot call the destructor of a local explicitly?
Define 'std'.
Why is c++ is better than c?
What is the difference between a baller and a reference in C++?