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 / d.sakthi
ans is 1 option b
reason:as three classes are derived from base class single instance is enough
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is const pointer and const reference?
What is the benefit of learning c++?
What is data type in c++?
Is string an object in c++?
What is a map in c++?
What is the use of 'this' pointer?
Can c++ do everything c can?
Explain virtual destructor?
Is overriding possible in c++?
What is the use of function pointer?
What are the unique features of C++.
What kind of jobs can I get with c++?
Can you Mention some Application of C/C++?
What is a loop? What are different types of loops in c++?
Define a nested class. Explain how it can be useful.