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 |
check whether a no is prime or not.
What is the difference between public and private data members?
What is the best it certification?
Explain abstraction.
What is the use of :: operator in c++?
write a program in c++ to generate imp z y x w v w x y z z y x w x y z z y x y z z y z z
How delete [] is different from delete?
What is ofstream c++?
What does count ++ do in c++?
What is an inclusion guard?
What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?
Explain the differences between private, public and protected and give examples.