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
Answers were Sorted based on User's Feedback
Answer / ahsanullah
becouse of virtual keyword it will create only one instances,
so ANS is: 1
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / 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 |
What is the difference between a copy constructor and an overloaded assignment operator?
4 Answers Belzabar, Citrix, Microsoft, Wipro,
What are stacks?
Does improper inheritance have a potential to wreck a project?
Which should be more useful: the protected and public virtuals?
What are Binay tress and B trees? Diff between them?
i have given a project to create examination seating plan system in c++. so can anyone send me the answer of this question quickly??????
How are Structure passing and returning implemented by the compiler?
What is the real purpose of class – to export data?
Explain object slicing in c++?
Is c# written in c++?
What is an orthogonal base class in c++?
Can I have a reference as a data member of a class? If yes, then how do I initialise it?