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 are the rules about using an underscore in a c++ identifier?
What is c++ w3school?
What are the two types of comments?
Write a Program to find the largest of 4 no using macros.
Is java as fast as c++?
What is c++ mutable?
Explain the extern storage classes in c++.
reading material is provided 3 books for c++ if u need more do let me know thnx i hve lots of material do let me know if u want it
Why is c++ difficult?
What is a constructor in c++ with example?
What is capacity in vector in c++?
What are compilers in c++?