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 c++ and its uses?
Give a very good method to count the number of ones in a "n" (e.g. 32) bit number.
const char * char * const What is the differnce between the above two?
What is #include iostream?
What is a singleton class c++?
Problem 6: Area of a trapezoid can be calculated by the following formula: A=(b1 b2)×h2 where b1 and b2 are the parallel sides or the bases and h is length of height Write a C code of this program
Which programming language is best?
How can I learn dev c++ programming?
Is there a new/delete equivalent of realloc?
What is Namespace?
what is importance of data sturture in a programming language?
22 Answers L&T, TCS, Wipro,
What are features of c++?