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
This question is related to BirlaSoft Interview

Showing Answers 1 - 3 of 3 Answers

Sujit Roy

  • Jun 10th, 2005

Since it is a virtual class So the object will contain only one instance of class Professor.  
So answer is (b)

  Was this answer useful?  Yes


  • Jun 10th, 2007

It will get one instance of professor so answer is (b)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions