Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



class professor {}; class teacher : public virtual professor {}; class researcher : public virtu..

Answer / guest

Ans is value 1 i.e ans B

Is This Answer Correct ?    22 Yes 0 No

class professor {}; class teacher : public virtual professor {}; class researcher : public virtu..

Answer / ahsanullah

becouse of virtual keyword it will create only one instances,
so ANS is: 1

Is This Answer Correct ?    6 Yes 0 No

class professor {}; class teacher : public virtual professor {}; class researcher : public virtu..

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

class professor {}; class teacher : public virtual professor {}; class researcher : public virtu..

Answer / alliance group

answer is 1......b option

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C++ General Interview Questions

Write some differences between an external iterator and an internal iterator?

0 Answers  


Explain about profiling?

1 Answers  


What is the use of volatile keyword in c++? Give an example.

1 Answers  


what is VOID?

0 Answers  


Can a program run without main function?

0 Answers  


How will you call C functions from C ++ and vice-versa?

0 Answers   Agilent, Tavant Technologies, Thomson Reuters, Verifone,


Why is it necessary to use a reference in the argument to the copy constructor?

0 Answers  


What are the types of container classes?

0 Answers  


Floating point representation and output seems to be compiler dependent?

1 Answers  


difference between the c++ and c languages

4 Answers   Wipro,


Explain the difference between using macro and inline functions?

0 Answers  


what is meaning of isa and hsa

1 Answers  


Categories