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 A {
public:
void f();
protected:
A() {}
A(const A&){}
};

Examine the class declaration shown above. Why are the
default and copy constructors declared as protected?

1. To ensure that A cannot be created via new by a more
derived class
2. To ensure that A cannot be copied
3. To ensure that A cannot be used as a base class except
when public inheritance has been used
4. To ensure that A cannot be created/copied outside the
inheritance chain
5. To ensure that A cannot be instantiated as a static variable



class A { public: void f(); protected: A() {} A(const A&){} }; Examine the ..

Answer / prasenjit roy

4. To ensure that A cannot be created/copied outside the
inheritance chain

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More C++ General Interview Questions

When is dynamic checking necessary?

0 Answers  


What is an object in c++?

1 Answers  


What return value must conversion operators have in their declaration?

0 Answers  


What is size of null class?

6 Answers   HP,


What is function declaration in c++ with example?

0 Answers  


What is type of 'this' pointer? Explain when it is get created?

0 Answers  


what is static function

2 Answers   Patni,


When one must use recursion function? Mention what happens when recursion functions are declared inline?

0 Answers  


What is prototype for that c string function?

0 Answers  


Can constructor be private in c++?

0 Answers  


Explain the virtual inheritance in c++.

0 Answers  


Explain what happens when a pointer is deleted twice?

0 Answers  


Categories