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


Please Help Members By Posting Answers For Below Questions

What is decltype c++?

637


Is it possible to have a recursive inline function in c++?

659


why is c++ called oops? Explain

668


explain the reference variable in c++?

683


What are advantages of c++?

658






Explain overriding.

681


What is a character in c++?

657


What is ofstream c++?

697


What is #include ctype h in c++?

763


Explain deep copy and a shallow copy?

694


Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

2160


What is flush c++?

633


What is the use of default constructor?

662


What is the difference between global variables and local variable

616


What is atoi?

632