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 c++ array?
Which coding certification is best?
What is null pointer and void pointer and what is their use?
What is a constant reference?
Define a conversion constructor?
What is the C-style character string?
What are references in c++?
Explain about vectors in c ++?
When should you use global variables?
What is capacity in vector in c++?
Write a note about the virtual member function?
Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work
What is difference between n and endl in c++?
Why do we use vector in c++?
Write about the use of the virtual destructor?