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 containers in c++?
What is the maximum combined length of command line arguments including the space between adjacent arguments?
What it is and how it might be called (2 methods).
What new()is different from malloc()?
How is c++ different from java?
How would you differentiate between a pre and post increment operators while overloading?
What is the equivalent of Pascal's Real a) unsigned int b) float c) char
Explain deep copy?
What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h
Describe private, protected and public?
What is the Standard Template Library?
What does scope resolution operator do?